Harri's profilePainKiller´s C# CornerBlogListsNetworkMore ![]() | Help |
|
|
Truncate log on SQL 2008Some times old tricks just dies, thats what happend with "BACKUP LOG WITH TRUNCATE_ONLY"
When you run that on a SQL 2008 server you will read: "truncate_only' is not a recognized BACKUP option"
It´s gone deprecated because of misuse (what?), anywhay this the new style of doing the same thing wich is to clear the logfile.
USE dbname;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE dbname
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (2, 1); -- here 2 is the file ID for trasaction log file,you can also mention the log file name (dbname_log)
GO
-- Reset the database recovery model.
ALTER DATABASE dbname
SET RECOVERY FULL;
GO TrackbacksThe trackback URL for this entry is: http://csharp3.spaces.live.com/blog/cns!E0D0E097982463FD!186.trak Weblogs that reference this entry
|
|
|