May 27, 2010 at 9:16 am
May 27, 2010 at 9:38 am
Beautiful question, well done
May 27, 2010 at 10:53 am
Good question!! Thank you.
May 27, 2010 at 11:37 am
muhammad.mazhar (5/27/2010)
i chose the last answer, cause this is what happend to me. But my answer is wrong. I don't understand. what I'm missing here?Regards,
Mazhar Karimi
What you are missing is that the question was not "what happens if you run this code", but "what is the result of the SELECT statements". The error you do see is caused by the trigger.
Or, another way to put it, you are missing that the point of these questions is to think about it, not to test your ability to copy/paste.
May 27, 2010 at 3:38 pm
great question
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 27, 2010 at 8:56 pm
Hugo Kornelis (5/27/2010)
Or, another way to put it, you are missing that the point of these questions is to think about it, not to test your ability to copy/paste.
Firm but fair :laugh:
May 28, 2010 at 7:07 am
I got it right for the wrong reason.
DDL has never been my strong suit. This question came with some good background reading that was very educational.
Thanks.
May 31, 2010 at 12:27 pm
Great question! I missed rollback and got it wrong.
June 1, 2010 at 8:33 pm
Thanks, learned another thing today!
June 3, 2010 at 3:30 am
After Execution Error through
(1 row(s) affected)
Msg 208, Level 16, State 1, Procedure test_ddl, Line 6
Invalid object name 'test_logs'.
(1 row(s) affected)
October 17, 2010 at 4:03 pm
Terrific question.
My brain was not working correctly - for some reason I decided that since DDL triggers (unlike DML triggers, which have an "instead" option) always execute after the DDL statement that fires them has completed, in autocommit mode they would execute after the DDL statement had committed - a crazy aberration! I knew it was wrong as I clicked the submit button, because I suddenly remembered that the DDL trigger example everyone uses is the one that displays an error message and rolls back a DROP, and this only works because the trigger and the DROP are parts of the same autocommit unit (transaction). Oh well, I won't forget that as easily again so the question has done me some good (and was fun to think through).
Tom
Viewing 11 posts - 16 through 26 (of 26 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy