March 15, 2016 at 4:02 pm
Thanks Hugo. You helped me in this initially. I will keep these similar requirements in a single thread in future.
March 16, 2016 at 6:05 am
Hugo Kornelis (3/15/2016)
This appears to be the same code you also asked help for in this topic: http://www.sqlservercentral.com/Forums/Topic1767785-3411-1.aspx.In the future, please keep questions on the same issue in the same topic, and only start a new topic if you have a new problem, or if the focus of the issue has changed so much that it can be considered a new problem.
@jack-2: You added a comment in the trigger code (which was originally suggested by me in that other topic) that the test on EXISTS in inserted is redundant. That is not the case. When a MERGE statement executes, you can have a trigger fire with @@ROWCOUNT > 0 but inserted empty.
Thanks Hugo, didn't realize that this happened with MERGE.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply