whats best practice for Log Truncation in SQL Server?

Posted by kacalapy on Stack Overflow See other posts from Stack Overflow or by kacalapy
Published on 2011-02-28T15:23:20Z Indexed on 2011/02/28 15:25 UTC
Read the original article Hit count: 234

Filed under:

i have a production DB in SQL server and wanted to put the final touches after the functionality is completed. prior to shipping it out i want to make sure i have some clean up in the SQL server DB and truncate and shrink log files?

can i have a nightly job run to truncate logs and shrink files?

this is what i have so far:

ALTER proc [dbo].[UTIL_ShrinkDB_TruncateLog]
as

-- exec sp_helpfile
BACKUP LOG PMIS WITH TRUNCATE_ONLY

DBCC SHRINKFILE (PMIS, 1)

DBCC SHRINKFILE (PMIS, 1)

© Stack Overflow or respective owner

Related posts about sql-server-2005