Asp.net programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this Asp.net and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Asp.net Website by URL, How to Play YouTube Videos in Asp.net by using Jquery , Jquery Change div background on mouseover in asp.net , JQuery UI Datepicker (Calendar) etc.

Saturday, August 22, 2015

How to create a trigger of Example of AFTER INSERT Trigger.

How to create a trigger of Example of AFTER INSERT Trigger


Example of AFTER INSERT Trigger:


In my past post “what is the trigger” we give the full explanation of sql Trigger. In this post we explain what is trigger and how many types of trigger in sql server. Now today we are giving to learn how to make a trigger and see the working of sql Trigger.

So for creating the trigger first create a table in sql database.

Create table emp
(
empId int,
empName varchar(50)
)




Let’s create trigger (AFTER INSERT Trigger)


Create trigger trginsert on emp
For INSERT
AS
Declare @empID int;
Declare @ empName varchar (50);

Select @empid=i.empId form insert i;
Select @empName=i.empName form insert i;
(empid,empName)value(@empid,@empName)

No comments:

Post a Comment