Wednesday 16 October 2013

03. Create a trigger on the Product table to ensure that if the value for the SafetyStockLevel column becomes less than or equal to the specified ReorderPoint column for a product because of an update operation, a message informing that the reorder level has been attained should be displayed.

create Trigger OrderStock
on Production.Product
for update
as
declare @PID varchar
select @PID=ProductID from inserted
if((select safetyStockLevel from INserted)<=
(select ReorderPoint from inserted))
Begin
print'The stock of'+@PID+
'is unber the reorder point'
end

No comments:

Post a Comment