Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I identify the trigger within the trigger code?

Status
Not open for further replies.

manohars

Programmer
Feb 28, 2004
97
US
Suppose, I write a single trigger for all the transactions, INSERT, UPDATE, DELETE. Is it possible to identify, which trigger(INSERT, UPDATE or DELETE) fires this trigger code?

Thanks in Advance,
Manohar
 
You could check the number of rows in the inserted and deleted tables. If inserted is 0 then it's a delete, if deleted is 0 then it's an insert if both have records, it's an update.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top