create trigger afterupdate
on emp
AFTER UPDATE
as
begin
declare @name varchar(50)
declare @fname varchar(50)
declare @ser numeric(18,0)
select @name=name from inserted
select @fname=fname from inserted
select @ser=ser_num from inserted
update copy set name=@name ,fname=@fname where ser_num=@ser
PRINT 'AFTER TRIGGER EXECUTED SUCESSFULLY'
end
GO
insert into emp(name,fname)values('abc','xyz');
update emp set name='ajay', fname='sh.sp sharma' where ser_num='7'
0 comments:
Post a Comment