sqlserver触发器,有a、b表,修改a表的密码时,也修改b表的该用户密码!

2024-12-15 21:51:43
推荐回答(1个)
回答1:

createtrigger tgr_a_update
on a
for update
as
declare @oldName varchar(50),@id varchar(20)
select @oldName = 密码,@id=id from deleted

update b set 密码=@oldName where id=@id