清除sql server日志
DECLARE @Sql NVARCHAR(max)
DECLARE @dbname NVARCHAR(50)
SET @dbname='GuangDong';--设置数据库名称
SET @Sql='USE ['+@dbname+']
ALTER DATABASE ['+@dbname+']
SET RECOVERY SIMPLE;
DECLARE @fileId INT
SELECT @fileId=file_id FROM sys.database_files WHERE type=1
DBCC SHRINKFILE (@fileId,1)
ALTER DATABASE ['+@dbname+']
SET RECOVERY FULL;
DBCC SHRINKDATABASE(['+@dbname+'],TRUNCATEONLY)'
EXEC sys.sp_executesql @Sql