How to determine if insert or update

后端 未结 5 688
庸人自扰
庸人自扰 2020-12-07 00:03

Whenever INSERT is happened in the CUSTOMER table,I need to call the \"StoredProcedure1\"and UPDATE is happend in the CUSTOMER table,I need to call the \"

5条回答
  •  鱼传尺愫
    2020-12-07 00:48

    Let SQL Server be SQL Server, and have it do the work for you!

    Create separate triggers for each change event (insert,update and/or delete). Put the logic for each into the trigger that needs it. No need to have to check for the event type.

    And don't call a procedure unless it is quick, fast, and can't block others.

提交回复
热议问题