May 2009
M T W T F S S
« Apr   Jul »
 123
45678910
11121314151617
18192021222324
25262728293031

11
May
09

Force a truncation of a SQL log

I ran into an issue recently with a log file that would not shrink. All the DB Truncates that I ran would not shrink it. The fix is to just detach the DB, rename the log file and reattach. That will create a new log file from scratch.

Detail are here

sp_detach_db [YourDatabaseName]

then

sp_attach_db @dbname = N‘YourDatabaseName’,
@filename1 = N‘D:\Microsoft SQL Server1\MSSQL\Data\YourDatabaseName.MDF’


0 Responses to “Force a truncation of a SQL log”


  1. No Comments