• Your approach will only compare the first updated value, whereas "first" is equal "first random" in this case since there is no ORDER BY.

    When you use triggers always make sure to be ready to deal with multiple result sets.

    So, instead of assigning the first value to a variable, compare the two tables (inserted and deleted) directly using NOT EXISTS().

    Question aside (please, don't get me wrong): is this some kind of homework?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]