我想要带有触发器的备份数据库。当我写这个查询时
{{1}}
我收到错误消息:
Msg 3021,Level 16,State 0,Procedure SPTEST,Line 6
无法在事务中执行备份或还原操作。Msg 3013,Level 16,State 1,Procedure SPTEST,Line 6
BACKUP DATABASE异常终止。
请帮帮我
答案 0 :(得分:0)
CREATE TRIGGER test
ON Table_1
AFTER INSERT
AS
BEGIN
COMMIT TRANSACTION
BACKUP DATABASE test TO DISK = N'C:\test.bak' WITH NOFORMAT, NOINIT, NAME = N'pcrm-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
BEGIN TRANSACTION
END
GO