34,588
社区成员
发帖
与我相关
我的任务
分享
create trigger tri_users_insert
on users
after insert
as
begin
update u
set u.companyName=c.companyName
from users u,inserted i,company c
where i.companyId=c.companyId and i.companyId=u.companyId
end
create trigger tri_users_insert
on users
instead of insert
as
begin
insert users
select i.name,i.companyId,c.companyName
from inserted i,company c
where i.companyId=c.companyId
end