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 ««1234»»»

DML Triggers Expand / Collapse
Author
Message
Posted Wednesday, December 12, 2007 9:53 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, January 15, 2013 10:46 AM
Points: 911, Visits: 831
To whomever creeated this question, please check BOL, under "Types of DML Triggers" topic.

It clearly states there are three types of DML triggers. But if you count the FOR trigger, that would be 4.
Post #432418
Posted Wednesday, December 12, 2007 12:10 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, August 8, 2014 6:08 PM
Points: 872, Visits: 953
I agree with rlondon. Answer should be 4; FOR is the only option available in earlier versions of Microsoft SQL Server for AFTER triggers and the question did not specifically ask for SQL Server 2005.

Post #432488
Posted Wednesday, December 12, 2007 12:13 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, August 8, 2014 6:08 PM
Points: 872, Visits: 953
Prashant Pandey (12/12/2007)

But tell you the intresting thing that i have also ticked the 2nd option that is
3 types (DML triggers, DDL triggers and Logon triggers)
But if u'll read the question carefully then the question and answer both are correct.


Prashant, didn't you post the question in the first place??
Post #432491
Posted Wednesday, December 12, 2007 12:19 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 4:12 PM
Points: 3,475, Visits: 582
I was surprised at the logic:
"....This link also contain CLR Triggers but they can also be a DDL trigger that is why they cannot be count under the pur DML triggers category..."

If CLR Triggers can be something else than DML Triggers, it does not mean it is not the valid type for DML Triggers. It just means it is the valid type for other types of triggers too. The question was "How many types for DML Triggers" and it is 3. This is similar of how we have a "priority one" for so many different things and the fact that we have issues of "priority one" , tasks of "priority one", goals of "priority one" etc does not mean that "priority one" is not a valid type for issues for example because it is a valid type for many other categories.



Regards,
Yelena Varshal

Post #432494
Posted Wednesday, December 12, 2007 12:41 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, November 17, 2008 9:27 PM
Points: 81, Visits: 128
Yelena Varshal (12/12/2007)
I was surprised at the logic:
"....This link also contain CLR Triggers but they can also be a DDL trigger that is why they cannot be count under the pur DML triggers category..."

If CLR Triggers can be something else than DML Triggers, it does not mean it is not the valid type for DML Triggers. It just means it is the valid type for other types of triggers too. The question was "How many types for DML Triggers" and it is 3. This is similar of how we have a "priority one" for so many different things and the fact that we have issues of "priority one" , tasks of "priority one", goals of "priority one" etc does not mean that "priority one" is not a valid type for issues for example because it is a valid type for many other categories.


HI,
ur right... i think i am wrong, But if u see that question is "How many Types of DMLTriggers" so i think if u ask about all versions of sql then commonly there are two. AFTER and INSTEAD and FOR is not a seprate it comes under AFTER,
CLR Triggers are implemented in SQL 2005. they are not in 7.0 and 2000 and i think AFTER and INSTEAD OF both are there in all versions.
but if u consider the latest which always prefered .. then question needs some modification and it should be like below.

How many Types of DML Triggers in the SQL2005??
and answer will be AFTER, INSTEAD OF and CLR Triggers.

What you think???


Thanks,
Prashant
Post #432501
Posted Wednesday, December 12, 2007 1:31 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, January 14, 2013 10:34 PM
Points: 428, Visits: 334
I find a certain shortcoming in the logic of the answer -- its the logic of an attorney not of a mathematician. ;) I seldom reply to the QOD thing, but BOL was clear; http://msdn2.microsoft.com/en-us/library/ms178134.aspx

Because a CLR trigger can be a DDL trigger does NOT mean that it is not a DML trigger -- sheesh!
Post #432527
Posted Wednesday, December 12, 2007 2:48 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 8, 2014 1:18 PM
Points: 2,664, Visits: 830
I haven't used CLR or researched it much, but as far as DML goes, surely CLR triggers would fall under the same logic as a traditional DML trigger:

1. do [action] AFTER insert/update/delete

OR

2. do [action] INSTEAD OF insert/update/delete

The CLR bit as far as I can see is just an alternative to T-SQL. Where it appears in BOL is not necessarily an indication of correctness as far as this QoD goes, seeing as CLR triggers can be either DML or DDL. Perhaps BOL should state 'DML|DDL triggers can be written in either T-SQL or CLR'.

/Edit: must stop using gt/lt brackets, they get stripped out.




Scott Duncan

MARCUS. Why dost thou laugh? It fits not with this hour.
TITUS. Why, I have not another tear to shed;
--Titus Andronicus, William Shakespeare
Post #432562
Posted Wednesday, December 12, 2007 2:50 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, May 30, 2013 9:03 AM
Points: 1,921, Visits: 549
I'm not a huge fan of the BOL article referenced, http://msdn2.microsoft.com/en-us/library/ms178134.aspx. I answered the question as the author of the question intended, so I'm a bit biased, but I think that BOL calling CLR a type of trigger, just like AFTER or INSTEAD OF, is logically inconsistent. CLR is just a means for creating a DML or DDL trigger, which I think is supported by other descriptions elsewhere in BOL, including the oft-cited article in this thread. And what does 'type' actually mean? In this case it seems to mean WHEN the trigger should do its action....that is until you bring CLR into it. CLR does not answer WHEN but rather how the trigger is created.

Anyway, I still think that BOL article is bad, adds nothing to the understanding of triggers, and the information in it could probably be rolled into both the descriptions for DML and DDL triggers as well as articles on creating triggers using CLR.
Post #432564
Posted Wednesday, December 12, 2007 4:48 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, January 15, 2013 10:46 AM
Points: 911, Visits: 831
Prashant Pandey (12/12/2007)
Yelena Varshal (12/12/2007)
I was surprised at the logic:
"....This link also contain CLR Triggers but they can also be a DDL trigger that is why they cannot be count under the pur DML triggers category..."

If CLR Triggers can be something else than DML Triggers, it does not mean it is not the valid type for DML Triggers. It just means it is the valid type for other types of triggers too. The question was "How many types for DML Triggers" and it is 3. This is similar of how we have a "priority one" for so many different things and the fact that we have issues of "priority one" , tasks of "priority one", goals of "priority one" etc does not mean that "priority one" is not a valid type for issues for example because it is a valid type for many other categories.


HI,
ur right... i think i am wrong, But if u see that question is "How many Types of DMLTriggers" so i think if u ask about all versions of sql then commonly there are two. AFTER and INSTEAD and FOR is not a seprate it comes under AFTER,
CLR Triggers are implemented in SQL 2005. they are not in 7.0 and 2000 and i think AFTER and INSTEAD OF both are there in all versions.
but if u consider the latest which always prefered .. then question needs some modification and it should be like below.

How many Types of DML Triggers in the SQL2005??
and answer will be AFTER, INSTEAD OF and CLR Triggers.

What you think???


I think INSTEAD OF trigger started with SQL 2000. That would make none of your choices valid.

I don't think your logic here is correct. If your original question intended to encompass versions 7.0, 2000, and 2005 without explicitly listing them, what about earlier versions like 6.x or 4.x?
Post #432609
Posted Wednesday, December 12, 2007 5:10 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 1:47 AM
Points: 488, Visits: 404
Ok, so CLR isn't a PURE DML trigger. But it CAN be a DML trigger.
I've checked and rechecked, and the word 'pure' doesn't occur in the question.
It's a very misleading/ambiguous Q. So as the answer I wanted wasn't there (the 3 as in BOL), I decided the answer was 1 - a DML trigger is a DML trigger!
Post #432614
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse