Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dohamsg
Starting Member
22 Posts |
Posted - 2012-08-01 : 13:56:34
|
Hi,If I create a trigger like:CREATE TRIGGER tr_AccountBalanceON [dbo].[JournalEntryLine]AFTER INSERT, UPDATE, DELETEAS...Q/ Is it possible to know which event was triggered : INSERT, UPDATE or DELETE?Thanks. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-08-01 : 14:12:02
|
If INSERTED isn't empty and DELETED is empty then event=insert.If DELETED isn't empty and INSERTED is empty then event=delete.If both INSERTED and DELETED are not empty then event=update. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|