How to truncate and shrink Transaction Log file in SQL Server 2008 R2

select name,recovery_model_desc from sys.databases
GO
Alter database DATABASENAME Set Recovery simple
GO
Declare @LogFileLogicalName sysname
select @LogFileLogicalName=Name from sys.database_files where Type=1
print @LogFileLogicalName
DBCC Shrinkfile(@LogFileLogicalName,100)
 
 

Tags:

Leave a Reply

You must be logged in to post a comment.