SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Tell me Triggers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kishore74
Starting Member

India
2 Posts

Posted - 12/04/2013 :  23:23:59  Show Profile  Reply with Quote
Good Morning to every one.This is kishore.I am not understanding the T-SQL triggers.please explained with example.








Thank you,
Regards,
kishore.

Thank you,
Regards,
kishore.

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/05/2013 :  01:42:56  Show Profile  Reply with Quote
see below

http://technet.microsoft.com/en-us/library/ms189799.aspx

Read through and post part you've doubt with

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kishore74
Starting Member

India
2 Posts

Posted - 12/05/2013 :  08:18:55  Show Profile  Reply with Quote
Thank you for replaying visakh.

BUT
I have already see but i am n't understanding. please tell me another example.

Thank you,
Regards,
kishore.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 12/05/2013 :  12:09:20  Show Profile  Reply with Quote
first of tell as what part you didnt understand
Triggers are like special type of stored procedures which will get executed in response to an event (DML/DDL/LOGON). You may right logic you want inside it which needs to be executed in response to each of the action. Also for DML trigger you can also control when it need to get executed (before or after the event designated by AFTER and INSTEAD OF triggers) and defined for each of the events (INSERT/UPDATE/DELETE).
DML triggers work by means of two internal temporary tables INSERTED and DELETED which assume the structure of table on which trigger is defined.
INSERTED will contain values which are inserted in case of INSERT operations and modified values in case of UPDATE operations
DELETED will contain values which are deleted in case of DELETE operation and old values in case of UPDATES

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000