Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

DDL trigger Expand / Collapse
Author
Message
Posted Thursday, May 27, 2010 3:38 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 12:45 PM
Points: 17,947, Visits: 15,941
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
Post #929335
Posted Thursday, May 27, 2010 8:56 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: 2 days ago @ 7:53 PM
Points: 9,928, Visits: 11,194
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
Post #929421
Posted Friday, May 28, 2010 7:07 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 12:48 PM
Points: 2,818, Visits: 2,566
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.
Post #929642
Posted Monday, May 31, 2010 12:27 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 1:06 PM
Points: 1,264, Visits: 733
Great question! I missed rollback and got it wrong.
Post #930459
Posted Tuesday, June 1, 2010 8:33 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, September 5, 2014 2:00 PM
Points: 2,160, Visits: 2,191
Thanks, learned another thing today!
Post #931066
Posted Thursday, June 3, 2010 3:30 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 6:12 AM
Points: 134, Visits: 353
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)
Post #931944
Posted Sunday, October 17, 2010 4:03 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:38 AM
Points: 7,850, Visits: 9,600
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
Post #1005928
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse