What you will find here

If you are one of those multi hat kind of person you might want to take a look here.
Some of the sections here will cover: SharePoint, SQL, Server, VB Script, Batch files, PCI Compliance

Icon

Icon

Friday, March 28, 2014

Easy way to Shrink databases Log


Easy to set up as an scheduled task

USE DatabaseName
GO
DBCC SHRINKFILE(<TransactionLogName>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLogName>, 1)
GO

Same apply to the database file

USE [RC_BI_DW]  DBCC SHRINKFILE (N<Database file name> , 0, TRUNCATEONLY)

No comments:

Post a Comment