使用SQL Server
Backup Log DNName with no_log
go
dump transaction DNName with no_log
go
USE DNName
DBCC SHRINKFILE (
Go
不過這個存儲過程在SQL Server
USE [master]
GO
ALTER DATABASE DNName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DNName SET RECOVERY SIMPLE
GO
USE DNName
GO
DBCC SHRINKFILE (N
GO
USE [master]
GO
ALTER DATABASE DNName SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DNName SET RECOVERY FULL
GO
另外
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22359.html