use [master] alter database [db_develop] set recovery simple with no_wait alter database [db_develop] set recovery simple go use [db_develop] declare @logname varchar(150) select @logname = name from sys.database_files where name like'%log' dbcc shrinkfile(@logname, 11, truncateonly) go use [master] alter database [db_develop] set recovery full with no_wait alter database [db_develop] set recovery full go
使用时将db_develop更换为你需要操作的数据库名即可。