if not Exists(select name from sysobjects where name='antiDel' and xtype='TR')
begin
CREATE TRIGGER antiDel ON [dbo].[tTmpAdd]
FOR DELETE
AS
insert into tATmpAdd select * from deleted
end服务器: 消息 156,级别 15,状态 1,行 3
在关键字 'TRIGGER' 附近有语法错误。
怎么会有错误呢?求解
begin
CREATE TRIGGER antiDel ON [dbo].[tTmpAdd]
FOR DELETE
AS
insert into tATmpAdd select * from deleted
end服务器: 消息 156,级别 15,状态 1,行 3
在关键字 'TRIGGER' 附近有语法错误。
怎么会有错误呢?求解
drop trigger antiDel
go
CREATE TRIGGER antiDel ON [dbo].[tTmpAdd]
FOR DELETE
AS
insert into tATmpAdd select * from deleted
begin
exec('
CREATE TRIGGER antiDel ON [dbo].[tTmpAdd]
FOR DELETE
AS
insert into tATmpAdd select * from deleted
')
end