Oct 20, 2011

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.

1 comment:

Anonymous said...

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

MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...