写了一半不会写了,新手啊!
如果修改A表的客户名称列 ,同时修改B表 客户名称列 ,怎么写个触发器呢
create Trigger Customers_Update
on Customers
for update
as
if Update(CustomersName)
begin
update Business set CustomersName=
end
求教了~~~

解决方案 »

  1.   

    create Trigger Customers_Update
    on Customers
    for update
    as
    if Update(CustomersName)
    begin
        update a 
        set a.CustomersName=b.CustomersName
        from Business a
        join inserted i on a.customersid=i.customersid
    end
      

  2.   

    create Trigger Customers_Update on Customers
    for update
    as
    if Update(CustomersName)
    begin
        update a 
        set a.CustomersName=b.CustomersName
        from Business a join inserted i on a.customersid=i.customersid
    end
      

  3.   


    alter Trigger Customers_Update
    on Customers
    for update
    as
    if Update(CustomersName)
    begin
        update a 
        set a.CustomersName=b.CustomersName
        from Business a
        join inserted i on a.CustomersId=i.CustomersId
    end错误:消息 4104,级别 16,状态 1,过程 Customers_Update,第 7 行
    无法绑定由多个部分组成的标识符 "Customers.CustomersName"。
      

  4.   

    消息 4104,级别 16,状态 1,过程 Customers_Update,第 7 行
    无法绑定由多个部分组成的标识符 "b.CustomersName"。
      

  5.   


    create Trigger Customers_Update
    on Customers
    for update
    as
    if Update(CustomersName)
    begin
        update a 
        set a.CustomersName=i.CustomersName
        from Business a
        join inserted i on a.customersid=i.customersid
    end修正笔误