Is there a way that i can rename some fields in a table using SQL from my
.NET program? The customer send sthem in as BMT Number and I need
BMT_Number, etc.
Thanks
dbWhat about looking in the BOL, there is an example for tenaming
columns:
Renaming a column
The following example renames the TerritoryID column in the
SalesTerritory table to TerrID.
Copy Code
USE AdventureWorks;
GO
EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';
GO
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
Showing posts with label program. Show all posts
Showing posts with label program. Show all posts
Tuesday, March 20, 2012
Friday, March 9, 2012
Removing old .bak & .trn files
I've run into a problem I didn't expect with my backup program. It seems
that Windows admins are very lax about writing scripts to remove old backup
files after copying them to tape, even though they say its easy, they don't
do it for all database backups on all servers in the farm.
So, I'm wondering first, if I should do it from my backup program (based on
RealSQLGuy's) and second, how I should go about it.
My rough thought is to do an xm_cmdshell('dir') in the backup directory into
a table variable, parse the date from the filename into a datetime column,
select the old files and issue an xp_cmdshell('del <file>') command via
dynamic sql.
Thanks,
JayHello Jay!
In SQL Server 2005, you could use Maintenance Plan Wizard to create a
Maintenance Cleanup Task to delete old bak and trn files.
Ekrem Önsoy
"Jay" <spam@.nospam.org> wrote in message
news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
> I've run into a problem I didn't expect with my backup program. It seems
> that Windows admins are very lax about writing scripts to remove old
> backup files after copying them to tape, even though they say its easy,
> they don't do it for all database backups on all servers in the farm.
> So, I'm wondering first, if I should do it from my backup program (based
> on RealSQLGuy's) and second, how I should go about it.
> My rough thought is to do an xm_cmdshell('dir') in the backup directory
> into a table variable, parse the date from the filename into a datetime
> column, select the old files and issue an xp_cmdshell('del <file>')
> command via dynamic sql.
> Thanks,
> Jay
>
>|||Maintenance plan in 2005?
Besides, I do all my maintenance through SQLagent after writing the scripts
myself.
"Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
news:OOO8bft9HHA.5424@.TK2MSFTNGP02.phx.gbl...
> Hello Jay!
>
> In SQL Server 2005, you could use Maintenance Plan Wizard to create a
> Maintenance Cleanup Task to delete old bak and trn files.
>
> --
> Ekrem Önsoy
>
> "Jay" <spam@.nospam.org> wrote in message
> news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
>> I've run into a problem I didn't expect with my backup program. It seems
>> that Windows admins are very lax about writing scripts to remove old
>> backup files after copying them to tape, even though they say its easy,
>> they don't do it for all database backups on all servers in the farm.
>> So, I'm wondering first, if I should do it from my backup program (based
>> on RealSQLGuy's) and second, how I should go about it.
>> My rough thought is to do an xm_cmdshell('dir') in the backup directory
>> into a table variable, parse the date from the filename into a datetime
>> column, select the old files and issue an xp_cmdshell('del <file>')
>> command via dynamic sql.
>> Thanks,
>> Jay
>>
>|||This is just me but I would create a batch file to delete the files and give
it to the Windows group to execute it after they do the tape backup. Make
sure that the batch file execution step depends on the tape backup so that
you are not without your backups if the tape backup fails.
"Jay" wrote:
> Maintenance plan in 2005?
> Besides, I do all my maintenance through SQLagent after writing the scripts
> myself.
> "Ekrem Ã?nsoy" <ekrem@.btegitim.com> wrote in message
> news:OOO8bft9HHA.5424@.TK2MSFTNGP02.phx.gbl...
> > Hello Jay!
> >
> >
> > In SQL Server 2005, you could use Maintenance Plan Wizard to create a
> > Maintenance Cleanup Task to delete old bak and trn files.
> >
> >
> > --
> > Ekrem Ã?nsoy
> >
> >
> > "Jay" <spam@.nospam.org> wrote in message
> > news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
> >> I've run into a problem I didn't expect with my backup program. It seems
> >> that Windows admins are very lax about writing scripts to remove old
> >> backup files after copying them to tape, even though they say its easy,
> >> they don't do it for all database backups on all servers in the farm.
> >>
> >> So, I'm wondering first, if I should do it from my backup program (based
> >> on RealSQLGuy's) and second, how I should go about it.
> >>
> >> My rough thought is to do an xm_cmdshell('dir') in the backup directory
> >> into a table variable, parse the date from the filename into a datetime
> >> column, select the old files and issue an xp_cmdshell('del <file>')
> >> command via dynamic sql.
> >>
> >> Thanks,
> >> Jay
> >>
> >>
> >>
> >
>
>
that Windows admins are very lax about writing scripts to remove old backup
files after copying them to tape, even though they say its easy, they don't
do it for all database backups on all servers in the farm.
So, I'm wondering first, if I should do it from my backup program (based on
RealSQLGuy's) and second, how I should go about it.
My rough thought is to do an xm_cmdshell('dir') in the backup directory into
a table variable, parse the date from the filename into a datetime column,
select the old files and issue an xp_cmdshell('del <file>') command via
dynamic sql.
Thanks,
JayHello Jay!
In SQL Server 2005, you could use Maintenance Plan Wizard to create a
Maintenance Cleanup Task to delete old bak and trn files.
Ekrem Önsoy
"Jay" <spam@.nospam.org> wrote in message
news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
> I've run into a problem I didn't expect with my backup program. It seems
> that Windows admins are very lax about writing scripts to remove old
> backup files after copying them to tape, even though they say its easy,
> they don't do it for all database backups on all servers in the farm.
> So, I'm wondering first, if I should do it from my backup program (based
> on RealSQLGuy's) and second, how I should go about it.
> My rough thought is to do an xm_cmdshell('dir') in the backup directory
> into a table variable, parse the date from the filename into a datetime
> column, select the old files and issue an xp_cmdshell('del <file>')
> command via dynamic sql.
> Thanks,
> Jay
>
>|||Maintenance plan in 2005?
Besides, I do all my maintenance through SQLagent after writing the scripts
myself.
"Ekrem Önsoy" <ekrem@.btegitim.com> wrote in message
news:OOO8bft9HHA.5424@.TK2MSFTNGP02.phx.gbl...
> Hello Jay!
>
> In SQL Server 2005, you could use Maintenance Plan Wizard to create a
> Maintenance Cleanup Task to delete old bak and trn files.
>
> --
> Ekrem Önsoy
>
> "Jay" <spam@.nospam.org> wrote in message
> news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
>> I've run into a problem I didn't expect with my backup program. It seems
>> that Windows admins are very lax about writing scripts to remove old
>> backup files after copying them to tape, even though they say its easy,
>> they don't do it for all database backups on all servers in the farm.
>> So, I'm wondering first, if I should do it from my backup program (based
>> on RealSQLGuy's) and second, how I should go about it.
>> My rough thought is to do an xm_cmdshell('dir') in the backup directory
>> into a table variable, parse the date from the filename into a datetime
>> column, select the old files and issue an xp_cmdshell('del <file>')
>> command via dynamic sql.
>> Thanks,
>> Jay
>>
>|||This is just me but I would create a batch file to delete the files and give
it to the Windows group to execute it after they do the tape backup. Make
sure that the batch file execution step depends on the tape backup so that
you are not without your backups if the tape backup fails.
"Jay" wrote:
> Maintenance plan in 2005?
> Besides, I do all my maintenance through SQLagent after writing the scripts
> myself.
> "Ekrem Ã?nsoy" <ekrem@.btegitim.com> wrote in message
> news:OOO8bft9HHA.5424@.TK2MSFTNGP02.phx.gbl...
> > Hello Jay!
> >
> >
> > In SQL Server 2005, you could use Maintenance Plan Wizard to create a
> > Maintenance Cleanup Task to delete old bak and trn files.
> >
> >
> > --
> > Ekrem Ã?nsoy
> >
> >
> > "Jay" <spam@.nospam.org> wrote in message
> > news:eQNEUct9HHA.5404@.TK2MSFTNGP02.phx.gbl...
> >> I've run into a problem I didn't expect with my backup program. It seems
> >> that Windows admins are very lax about writing scripts to remove old
> >> backup files after copying them to tape, even though they say its easy,
> >> they don't do it for all database backups on all servers in the farm.
> >>
> >> So, I'm wondering first, if I should do it from my backup program (based
> >> on RealSQLGuy's) and second, how I should go about it.
> >>
> >> My rough thought is to do an xm_cmdshell('dir') in the backup directory
> >> into a table variable, parse the date from the filename into a datetime
> >> column, select the old files and issue an xp_cmdshell('del <file>')
> >> command via dynamic sql.
> >>
> >> Thanks,
> >> Jay
> >>
> >>
> >>
> >
>
>
Removing Log File
I have a database call Runz in SQL Server 2000. When I checked the file
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amount
of space in the files, similar to a Compact and Repair in Access?
Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
Ekrem ?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
|||Thank you
"Ekrem ?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data and
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerate
> data loss so you can change your database' s recovery model to SIMPLE so the
> transactions will be truncated automatically and your log file will not grow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem ?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>
|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amount
of space in the files, similar to a Compact and Repair in Access?
Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
Ekrem ?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
|||Thank you
"Ekrem ?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data and
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerate
> data loss so you can change your database' s recovery model to SIMPLE so the
> transactions will be truncated automatically and your log file will not grow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem ?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>
|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
Removing Log File
I have a database call Runz in SQL Server 2000. When I checked the file
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amoun
t
of space in the files, similar to a Compact and Repair in Access?Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I not
ed
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data whic
h
> exists in the tables. Is there anything else I can do to decrease the amo
unt
> of space in the files, similar to a Compact and Repair in Access?
>
>|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
Ekrem ?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||Thank you
"Ekrem ?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data a
nd
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerat
e
> data loss so you can change your database' s recovery model to SIMPLE so t
he
> transactions will be truncated automatically and your log file will not gr
ow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem ?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I not
ed
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data whic
h
> exists in the tables. Is there anything else I can do to decrease the amo
unt
> of space in the files, similar to a Compact and Repair in Access?
>
>
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amoun
t
of space in the files, similar to a Compact and Repair in Access?Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I not
ed
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data whic
h
> exists in the tables. Is there anything else I can do to decrease the amo
unt
> of space in the files, similar to a Compact and Repair in Access?
>
>|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
Ekrem ?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||Thank you
"Ekrem ?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data a
nd
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerat
e
> data loss so you can change your database' s recovery model to SIMPLE so t
he
> transactions will be truncated automatically and your log file will not gr
ow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem ?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I not
ed
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data whic
h
> exists in the tables. Is there anything else I can do to decrease the amo
unt
> of space in the files, similar to a Compact and Repair in Access?
>
>
Removing Log File
I have a database call Runz in SQL Server 2000. When I checked the file
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amount
of space in the files, similar to a Compact and Repair in Access?Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
--
Ekrem Ã?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||Thank you
"Ekrem Ã?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data and
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerate
> data loss so you can change your database' s recovery model to SIMPLE so the
> transactions will be truncated automatically and your log file will not grow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem Ã?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
> >I have a database call Runz in SQL Server 2000. When I checked the file
> > sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> > the following:
> >
> > Runz_Data.MDF 558,400 KB
> > Runz_Log.LDF 517,184 KB
> >
> > When I checked the properties of the database in Enterprise Manager, I
> > noted
> > on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> > Data Files tab Space Allocated: 546 MB
> > Transaction Log tab Space Allocated: 506 MB
> >
> > I am trying to save disk space on my computer. Can I delete file
> > Runz_Log.LDF or remove all of its data, or does it actually hold data
> > which
> > exists in the tables. Is there anything else I can do to decrease the
> > amount
> > of space in the files, similar to a Compact and Repair in Access?
> >
> >
> >
> >
>|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
the following:
Runz_Data.MDF 558,400 KB
Runz_Log.LDF 517,184 KB
When I checked the properties of the database in Enterprise Manager, I noted
on the General tab Size: 1050.37 MB Space Available: 718.79 MB
Data Files tab Space Allocated: 546 MB
Transaction Log tab Space Allocated: 506 MB
I am trying to save disk space on my computer. Can I delete file
Runz_Log.LDF or remove all of its data, or does it actually hold data which
exists in the tables. Is there anything else I can do to decrease the amount
of space in the files, similar to a Compact and Repair in Access?Yes, backup the transaction log and then manually shrink it.
You may need to schedule at least daily transaction log backups.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||LDF file is an essential file of a database. It should not be deleted
otherwise you might get into bad trouble.
Every database has at least an MDF and LDF files. MDF files contain data and
LDF files contain transactions.
It can be truncated and shrinked to keep its file size under control.
If you do not take transaction log backups then that means you can tolerate
data loss so you can change your database' s recovery model to SIMPLE so the
transactions will be truncated automatically and your log file will not grow
that large.
You can find more info about recovery models from Books Online.
--
Ekrem Ã?nsoy
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
>I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I
> noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data
> which
> exists in the tables. Is there anything else I can do to decrease the
> amount
> of space in the files, similar to a Compact and Repair in Access?
>
>|||Thank you
"Ekrem Ã?nsoy" wrote:
> LDF file is an essential file of a database. It should not be deleted
> otherwise you might get into bad trouble.
> Every database has at least an MDF and LDF files. MDF files contain data and
> LDF files contain transactions.
> It can be truncated and shrinked to keep its file size under control.
> If you do not take transaction log backups then that means you can tolerate
> data loss so you can change your database' s recovery model to SIMPLE so the
> transactions will be truncated automatically and your log file will not grow
> that large.
> You can find more info about recovery models from Books Online.
> --
> Ekrem Ã?nsoy
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message
> news:4D485673-1D54-4ECA-8F7E-4203DD4CA06B@.microsoft.com...
> >I have a database call Runz in SQL Server 2000. When I checked the file
> > sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> > the following:
> >
> > Runz_Data.MDF 558,400 KB
> > Runz_Log.LDF 517,184 KB
> >
> > When I checked the properties of the database in Enterprise Manager, I
> > noted
> > on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> > Data Files tab Space Allocated: 546 MB
> > Transaction Log tab Space Allocated: 506 MB
> >
> > I am trying to save disk space on my computer. Can I delete file
> > Runz_Log.LDF or remove all of its data, or does it actually hold data
> > which
> > exists in the tables. Is there anything else I can do to decrease the
> > amount
> > of space in the files, similar to a Compact and Repair in Access?
> >
> >
> >
> >
>|||Thank you
"rmcompute" wrote:
> I have a database call Runz in SQL Server 2000. When I checked the file
> sizes in directory D:\program files\Microsoft SQL Server\MSSQL\Data, I got
> the following:
> Runz_Data.MDF 558,400 KB
> Runz_Log.LDF 517,184 KB
> When I checked the properties of the database in Enterprise Manager, I noted
> on the General tab Size: 1050.37 MB Space Available: 718.79 MB
> Data Files tab Space Allocated: 546 MB
> Transaction Log tab Space Allocated: 506 MB
> I am trying to save disk space on my computer. Can I delete file
> Runz_Log.LDF or remove all of its data, or does it actually hold data which
> exists in the tables. Is there anything else I can do to decrease the amount
> of space in the files, similar to a Compact and Repair in Access?
>
>
Subscribe to:
Posts (Atom)