如题: a表字段: Id,auditStatus b表字段: ID,aID,ischange
1, 0 1, 1 , 0
3, 0 2, 3 , 0
a表 id,相b表aID相关联.. 请问当我a表里的auditStatus更新为1时,怎么触发b表中与a表相关联的数据 ischange要更新 1
1, 0 1, 1 , 0
3, 0 2, 3 , 0
a表 id,相b表aID相关联.. 请问当我a表里的auditStatus更新为1时,怎么触发b表中与a表相关联的数据 ischange要更新 1
for update
as
update b set
ischange=1
from inserted i
where i.id=b.aid
and i.auditStatus=1
go
for update
as
update b set ischange=1 from inserted i where i.id=b.aid and i.auditstatus=1
go
for update
as
update b set
ischange=1
from inserted i,b b
where i.id=b.aid
and i.auditStatus=1
go
for update
as
update b set ischange=1
from inserted a
where a.id=b.aid and a.auditStatus=1
go