create trigger emp_UPdate_Trg
on employeeDetail After UpDATE
as
Begin
Declare @oldSal money
Declare @NewSal money
select @oldSal=salary from deleted
select @NewSal=Salary from Insertd
if @OldSal>@NewSal
begin
Rollback
print ('New salary cannot be less than the old salary')
end
end
on employeeDetail After UpDATE
as
Begin
Declare @oldSal money
Declare @NewSal money
select @oldSal=salary from deleted
select @NewSal=Salary from Insertd
if @OldSal>@NewSal
begin
Rollback
print ('New salary cannot be less than the old salary')
end
end
No comments:
Post a Comment