create trigger UpdatetriggerEPayHistory
on HumanResources.EmployeePayHistory
for update
as
if Update (rate)
begin
declare @AvgRate float
select @avgRate=Avg (Rate)
from HumanResources.EmployeePayHistory
if (@avgRate>20)
Begin
Print 'The averge value of rate connot be more than 20'
Rollback Transaction
end
end04.
on HumanResources.EmployeePayHistory
for update
as
if Update (rate)
begin
declare @AvgRate float
select @avgRate=Avg (Rate)
from HumanResources.EmployeePayHistory
if (@avgRate>20)
Begin
Print 'The averge value of rate connot be more than 20'
Rollback Transaction
end
end04.
No comments:
Post a Comment