使用時將DB_Develop更換為你需要操作的資料庫名即可。 ...
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更換為你需要操作的資料庫名即可。