USE [master]
GO ALTER DATABASE [數據庫名] SET RECOVERY SIMPLE WITH NO_WAIT GO ALTER DATABASE [數據庫名] SET RECOVERY SIMPLE GO USE [數據庫名] GO DBCC SHRINKFILE (N'[數據庫日志文件名稱]' , 0,TRUNCATEONLY) GO USE [master] GO ALTER DATABASE [數據庫名] SET RECOVERY FULL WITH NO_WAIT GO ALTER DATABASE [數據庫名] SET RECOVERY FULL GO --查詢指定數據庫的日志文件名稱 USE [數據庫名] GO SELECT name FROM SYS.database_files WHERE type_desc='LOG'