Posts belonging to Category 'transaction logs'

Shrink All Log Files Within A MS SQL 2008 Instance

This is an update to a previous post (Shrink All Log Files Within A MS SQL Instance) that has been edited to work in SQL Server 2008. declare @ssql nvarchar(4000) set @ssql= ‘ if ”?” not in (”tempdb”,”master”,”model”,”msdb”) begin use [?] declare @tsql nvarchar(4000) set @tsql = ”” declare @recmodel nvarchar(10) declare @iLogFile int declare [...]

Shrink SQL Transaction Logs

Here is the t-sql statement used to shrink the SQL transaction logs: Use <DatabaseName> Go Backup Log <DatabaseName> With Truncate_Only DBCC SHRINKFILE(<TransactionLogName>, 1) Go .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } [...]

Related Posts with Thumbnails