Hi, hoping someone could help me with these (hopefully) easy questions (although I did look in the docs and couldn't find an answer).
1. Is there anyway inside a trigger to determine if it was an update or delete which triggered the trigger? I would like to use the same trigger for both actions *but* change a bit of the logic slightly if it is an update
2. Secondly, is there anyway to select multiple columns from the INSERTED table inside a trigger and assign them to variables instead of using multiple statements..e.g.:
set @myvar = (select a from inserted)
set @myvar2 = (select b from inserted)
etc.
Thanks in advance
1. Is there anyway inside a trigger to determine if it was an update or delete which triggered the trigger? I would like to use the same trigger for both actions *but* change a bit of the logic slightly if it is an update
2. Secondly, is there anyway to select multiple columns from the INSERTED table inside a trigger and assign them to variables instead of using multiple statements..e.g.:
set @myvar = (select a from inserted)
set @myvar2 = (select b from inserted)
etc.
Thanks in advance