SQL2008 收缩日志和数据脚本

dbcc loginfo('DBNAME')

use DBNAME

declare @LogFileLogicalName sysname
select @LogFileLogicalName=Name FROM sys.database_files where type=1
print @LogFileLogicalName
DBCC SHRINKFILE (@LogFileLogicalName, 1)
DBCC SHRINKDATABASE(DBNAME)

你可能感兴趣的:(2008)