转载自http://www.cnblogs.com/rainman/p/5072689.html

USE [master]  
GO  
ALTER DATABASE students SET RECOVERY SIMPLE WITH NO_WAIT  
GO  
ALTER DATABASE students SET RECOVERY SIMPLE  
GO  
USE students  
GO
--此处需要注意,并非所有数据库的日志文件名都是“数据库名_log”  
DBCC SHRINKFILE (N'students_log' , 0,TRUNCATEONLY)  
GO  
USE [master]  
GO  
ALTER DATABASE students SET RECOVERY FULL WITH NO_WAIT  
GO  
ALTER DATABASE students SET RECOVERY FULL  
GO  
  
--查询指定数据库的日志文件名称  
USE students   
GO  
SELECT name FROM SYS.database_files WHERE type_desc='LOG' 

 

posted on 2017-11-27 20:23  你不知道的浪漫  阅读(540)  评论(0编辑  收藏  举报