create trigger my_tr1 on b
for updateif update(Support)
begin
--根据连接条件
--SupportCount在原来的基础上加1
endif update(Against)
begin
--根据连接条件
--a表的AgainstCount在原来的基础上加1
end
go

解决方案 »

  1.   

    --根据连接条件
    --SupportCount在原来的基础上加1
    一楼能不能写的详细点呵
      

  2.   

    create trigger my_tr1 on b
    for update
    as
    if update(Support)
    begin
    --根据连接条件
    --SupportCount在原来的基础上加1update a
    set a.SupportCount=a.SupportCount+1
    from a,inserted i
    where a.id = i.id--如果两表都有id,且相关联
    endif update(Against)
    begin
    --根据连接条件
    --a表的AgainstCount在原来的基础上加1update a
    set a.AgainstCount=a.AgainstCount+1
    from a,inserted i--如果两表都有id,且相关联
    where a.id = i.id
    end
    go