Hi
How can we define Trigger in SqlServer and define Syntax?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Priya LingePosted Nov 10, 2011, 12:29 AM
Please check below link which will help to understand the Trigger in SqlServer.
http://www.sqlteam.com/article/an-introduction-to-triggers-part-i
http://en.wikipedia.org/wiki/Database_trigger
Hope this will help you.
Thanks.
Prabhu RajaPosted Nov 10, 2011, 12:07 AM
The Basic Syntax of trigger is,
CREATE TRIGGER trigger_name
ON {table_name|view_name}[WITH ENCRYPTION]
{FOR|AFTER|INSTEAD OF} [INSERT] [,] [UPDATE] [,] [DELETE]
As
sql_statements
Check out this Article : http://www.c-sharpcorner.com/uploadfile/shashikantray/create-delete-and-update-triggers-in-a-database/
Javeed M ShaikhPosted Nov 9, 2011, 7:39 PM
Following is an example of INSERT Trigger in SQL Server:
CREATE TRIGGER myTrigger
ON myTable
FOR INSERT
AS
// your code comes here