Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Tell me Triggers

Author  Topic 

kishore74
Starting Member

2 Posts

Posted - 2013-12-04 : 23:23:59
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

52326 Posts

Posted - 2013-12-05 : 01:42:56
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

2 Posts

Posted - 2013-12-05 : 08:18:55
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

52326 Posts

Posted - 2013-12-05 : 12:09:20
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
   

- Advertisement -