CREATE
PROCEDURE
procedureName (@var1
as
varchar
(50),@var2
(50))
--建立未发临时表
AS
begin
tran
--doSth
DUMP
TRANSACTION
GJJ
WITH
NO_LOG
---------1.清空日志
BACKUP LOG GJJ
------------2.截断事务日志
DBCC SHRINKDATABASE(GJJ)
----------------- 3.收缩数据库
IF @@ERROR>0
BEGIN
ROLLBACK
END
ELSE
COMMIT
GO