DUMP TRAN <Dbname> WITH TRUNCATE_ONLY & MSSQL 2008

To Shrink the database log file I’ve used to,
   1:  
   2: DUMP TRAN <DatabaseName> WITH TRUNCATE_ONLY
   3: GO
   4:  
   5: USE <DatabaseName>
   6: DBCC SHRINKFILE (<DatabaseName>_log, 100);
   7: GO
   8:  


This is not work in SQL 2008, as DUMP is discontinued. Otherwise we have to use BACKUP.

To shrink the log file in SQL 2008,
  1. Back up the database in “SIMPLE” recovery mode.
  2. then run above line no 6.

Refer this (http://msdn.microsoft.com/en-us/library/ms144262.aspx) for discontinued functionalities in SQL 2008.

Comments

Anonymous said…
Thank you so much. I was able to shrink my log file with your post

Popular posts from this blog

IIS 7.5: 401 Unauthorized Access Error (Keep prompting Username/password)

Calculating Elapsed Time Accurately (C#)

Connecting DB2/iSeries From .net Application