学习:SQL数据库日志收缩(转)

 

declare @data varchar(20)

select @data= '数据库名'

execute ('execute sp_helpdb ' + @data )

execute (' BACKUP LOG ' + @data + ' WITH TRUNCATE_ONLY ' )

execute (' DBCC SHRINKDATABASE( ' + @data + ',10)')

execute ('execute sp_helpdb ' + @data )

 

文章来源:http://bbs.winos.cn/viewthread.php?tid=5999&extra=page%3D1%26amp%3Bfilter%3Dtype%26amp%3Btypeid%3D22

posted @ 2009-07-17 16:44  LeimOO  阅读(152)  评论(0编辑  收藏  举报