September 2005 - Posts

Download the Community Technology Preview (CTP) of Microsoft SQL Server 2005 :

http://www.microsoft.com/downloads/details.aspx?familyid=6e4aac3a-9d85-4734-b1fd-318fb83b0d29&displaylang=en


Download a stand-alone copy of the documentation and tutorials for the Microsoft SQL Server 2005 Community Technology Preview (CTP) September 2005 :

http://www.microsoft.com/downloads/details.aspx?familyid=adc75e35-7245-4038-9b8a-b8fabaec16da&displaylang=en


To Truncate the log file:

Backup the database (I always prefer to backup first to be on the safer side ;)).

Detach the database, either by using EM or by executing :

Sp_detachDB [DBName]

Delete the transaction log file. (I prefer to rename the file, just in case if something goes wrong)

Then attach the database again using:
Sp_AttachDB [DBName]

When the database is attached, it creates a new transaction log file.

 

To shrink the log first backup the log using:

backup log [DBName] with no_log

 

Using Enterprise manager:

 

Right click on the database, All tasks, Shrink database, Files, Select log file, OK.

Using T-SQL:

dbcc shrinkfile ([log_name])


Here [log_name] is the logical name of the log file as found from sp_helpdb

with 0 Comments