联级更新,代码如下: if exists(select name from sysobjects where name='update_b' and type='tr') drop trigger update_b go create trigger update_b on a with encryption for update as update(id) begin DECLARE @id as char(4) SELECT @id=id FROM inserted UPDATE b SET id=@id from deleted WHERE id=deleted.id end
if exists(select name from sysobjects where name='update_b' and type='tr')
drop trigger update_b
go
create trigger update_b
on a
with encryption
for update
as
update(id)
begin
DECLARE @id as char(4)
SELECT @id=id FROM inserted
UPDATE b
SET id=@id
from deleted
WHERE id=deleted.id
end
update(id),应是:
if update(id)