SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DML Triggers


DML Triggers

Author
Message
mojo-168709
mojo-168709
SSC Eights!
SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)

Group: General Forum Members
Points: 971 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.
Kangana Beri
Kangana Beri
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 954
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.
Kangana Beri
Kangana Beri
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 954
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??
Yelena Varshal
Yelena Varshal
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

Group: General Forum Members
Points: 4556 Visits: 595
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

Prashant Pandey
Prashant Pandey
SSC-Enthusiastic
SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)SSC-Enthusiastic (157 reputation)

Group: General Forum Members
Points: 157 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
Jim Howell
Jim Howell
SSC-Addicted
SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)SSC-Addicted (442 reputation)

Group: General Forum Members
Points: 442 Visits: 334
I find a certain shortcoming in the logic of the answer -- its the logic of an attorney not of a mathematician. Wink 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!
thecosmictrickster@gmail.com
thecosmictrickster@gmail.com
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3694 Visits: 939
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

Tim Benninghoff
Tim Benninghoff
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1949 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.
mojo-168709
mojo-168709
SSC Eights!
SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)SSC Eights! (971 reputation)

Group: General Forum Members
Points: 971 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?
brewmanz
brewmanz
Mr or Mrs. 500
Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)Mr or Mrs. 500 (543 reputation)

Group: General Forum Members
Points: 543 Visits: 406
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search