Home > Development, SQL > Truncate SQL Log File

Truncate SQL Log File

October 15th, 2011 Leave a comment Go to comments

Use the following script to shrink/truncate SQL database log file

USE [Database_Name]
GO
ALTER DATABASE [Database_Name] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(DB_Log_File_Logical_Name, 1)
ALTER DATABASE [Database_Name] SET RECOVERY FULL WITH NO_WAIT
GO

Use the following script to check the file size.

USE [Database_Name]
GO

select name,  size from sys.database_files

 

Categories: Development, SQL Tags: ,
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.