Le Kevin dot com

photographic-poetic-musical horizon

Browsing Posts tagged shrink

USE [master] GO /****** Object: StoredProcedure [dbo].[spShrinkAllDatabases] Script Date: 08/12/2011 15:40:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO — ============================================= — Author: Dan Sutton — Create date: 06/14/2011 — Description: Reindex all tables and shrink Logs and Data Files in Server — ============================================= CREATE PROCEDURE [dbo].[spShrinkAllDatabases] AS BEGIN SET NOCOUNT ON; DECLARE @dbname [...]

In SQL Server 2005, a shrink operation (DBCC SHRINKFILE) tries to shrink the specified transaction log file to the requested size immediately. To shrink the transaction log file manually under the full recovery model, first back up the transaction log file. Then, use the DBCC SHRINKFILE statement to shrink the transaction log file. Typically, shrinking [...]

To shrink the file size I use the following script: Use DBName Go exec sp_dboption DBName, ‘trunc. log on chkpt.’, true checkpoint DBCC SHRINKFILE (N’DBNameFileName, 0); exec sp_dboption DBName, ‘trunc. log on chkpt.’, false