|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Today @ 10:31 AM
Points: 18,857,
Visits: 12,442
|
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 7:53 AM
Points: 10,990,
Visits: 10,577
|
|
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
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 8:36 AM
Points: 2,681,
Visits: 2,423
|
|
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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 3:43 PM
Points: 1,259,
Visits: 704
|
|
| Great question! I missed rollback and got it wrong.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 9:45 AM
Points: 2,163,
Visits: 2,151
|
|
| Thanks, learned another thing today!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Saturday, June 15, 2013 8:15 AM
Points: 134,
Visits: 297
|
|
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)
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 4:53 PM
Points: 7,182,
Visits: 7,281
|
|
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 Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
http://es.linkedin.com/in/tomthomsonsoftware
|
|
|
|