Thursday, July 3, 2014

Triggers With Insert Command



create trigger abc on travel1
after insert
as
declare
@places varchar(20),
@introduction varchar(20),
@packages int

select @places=i.places from inserted i;
select @introduction=i.introduction from inserted i;
select @packages=i.packages from inserted i;
insert into travel(places,introduction,packages) values(@places,@introduction,@packages)
go

insert into travel1 values('hyderabad','Telangana',800)