whats best practice for Log Truncation in SQL Server?
- by kacalapy
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)