CLR Triggers for SQL Server 2005
page 8 of 9
by Soyuj Kumar Sahoo
Feedback
Average Rating: 
Views (Total / Last 10 Days): 23638/ 519

Checking the triggering action

Finally, we need to check our Trigger. Let us test the trigger using the same INSERT Statement that we used before.

Listing 7 (Insert into UserTable)

----- Checking the DB objects.----------------
INSERT UserTable (User_Name, Type) VALUES ('James''ADMIN')
Go
----- Output Message -----
May 2 2007  8:54AM
Hello !!! You have the Admin role.
We can use e-mail codes here to inform.

The output is the result of two triggering actions; one is of T-SQL type and another one is of CLR type. Both are attached to the UserTable for the same type of action (i.e. after Insert statement).  The following image is the output result window of SQL Server Management studio.

Figure 1: (Output result window)


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 5 and 4 and type the answer here:

User Comments

Title: cheta   
Name: Pandu
Date: 9/5/2008 1:34:13 AM
Comment:
Required info is not found
Title: good article   
Name: Digisha Modi
Date: 8/18/2008 12:35:26 AM
Comment:
This is very good article for a guy who is new for CLR Trigger. From this article they can get the basic idea how to develop a CLRTriggers.

Good & Thanks,
Digisha Modi.
Title: Simply Superb   
Name: Ashis Kumar Das
Date: 8/6/2008 7:25:18 AM
Comment:
I am very grateful to you for putting such a good information about triggers. I have understood what exactly a trigger means and i will try to implement it on our project.Thanks again...
Title: Simply Superb   
Name: Dsr
Date: 7/22/2008 8:07:46 AM
Comment:
Hello!! Hi,
This tutorial is very good. Post examples for Insert , Update and Delete.

Thank you very much
Title: Excellent   
Name: A R Soares
Date: 6/27/2008 11:21:02 AM
Comment:
Congratulations for the clarity with which managed to convey information which I always thought to be complex so that I could understand.
Title: Amazing   
Name: Shahejad Shaikh
Date: 6/24/2008 10:02:26 AM
Comment:
Its really very helpful.Give very much details about triggers in Sqlserver 2005.
Title: Very Helpful   
Name: Priya
Date: 6/24/2008 2:18:53 AM
Comment:
Really it helped a lot to know about triggers and CLR Triggers. Thanks a lot dude.
Title: Very Good   
Name: MadhusudhanReddy
Date: 6/17/2008 12:46:55 AM
Comment:
Hello,very nice. but give to the one r two examples.
Title: Trigger   
Name: Ravi
Date: 6/2/2008 1:38:27 AM
Comment:
Thank you. Good Article
Title: triggers   
Name: indian
Date: 5/10/2008 12:29:48 AM
Comment:
good
Title: insert,update,delete triggers in 2000   
Name: singh
Date: 4/29/2008 4:08:59 AM
Comment:
will u plz explain all these three triggers in brief.
u have just given an overview here
Title: Need in c#   
Name: Prakash
Date: 4/8/2008 10:49:19 AM
Comment:
will u please Explain in C#? prakash_naanuvar@yahoo.co.in
Title: pls explain this in C#   
Name: geetha
Date: 3/18/2008 2:49:57 AM
Comment:
hello sir/madam
tutorial is good and i satisfied but explain this clr and ddl triggers in C#
Title: very nice...   
Name: private
Date: 3/11/2008 12:55:25 AM
Comment:
Thank u....
Title: good   
Name: prof
Date: 3/2/2008 3:40:37 PM
Comment:
Good information
thanks
Title: excellent!!   
Name: Bindu
Date: 2/10/2008 8:52:07 AM
Comment:
Thankyou very much
Title: Plz help me with this doubt!!!   
Name: Vishwas Setty
Date: 11/18/2007 3:38:59 PM
Comment:
Hi there,

can we use this triggers in updating table values...ex: if i update a value in one table, it should reflect the same in another table??? Plz let me know how we can do this???
Title: Great Knowledge   
Name: Vishwas Setty
Date: 11/18/2007 3:30:39 PM
Comment:
Hi there,

I am very grateful to you for putting such a good information about triggers and i am happy to say that, i have understood what exactly a trigger means and i ll try to implement it on our project.Thanks again...
Vishwas
Title: Nice to learn abt Trigger   
Name: sandeep
Date: 9/29/2007 5:10:10 AM
Comment:
This is very good article to know that what is the relationship between stored procedure and Trigger.
Title: Good Article   
Name: Kesar
Date: 9/28/2007 12:47:18 PM
Comment:
Very good article..good effort.
Good luck
Title: Info   
Name: Amit
Date: 9/21/2007 8:09:54 AM
Comment:
Hi, Can we do this by using tables in different databases.
I mean i want to insert some data in TableA(in DatabaseA), On INSERT in TableB(in DatabaseB).
Please send a mail to me regarding the same on amit.sharma.rs@logicacmg.com

Thank You
Regards
Amit
Title: Good Article   
Name: vivek sisodia
Date: 7/23/2007 3:23:43 AM
Comment:
I think this is good article to know about trigger .
Title: Easy to do   
Name: Zé Luis
Date: 7/19/2007 10:50:14 AM
Comment:
Thankyou;
Title: Clear and precise article   
Name: Kartik Subramaniam
Date: 7/17/2007 1:06:51 AM
Comment:
Article is really good with decent comparison between the previous versions and the latest one.
Title: Good Article   
Name: DON
Date: 6/15/2007 2:34:52 AM
Comment:
Good Article
Title: CLR Triggers   
Name: Uday
Date: 5/20/2007 11:33:08 AM
Comment:
Simple but clearly illustrates all the types of triggers. Good job dude. Thanks a ton.






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 9/7/2008 7:20:11 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search