create Table Temp
(
ProductID int,
AttChangeCost money,
AttTime datetima
)
create trigger updtrigger on
Production.ProductCostHistory insert of UPdate
as
Begin
declare @Pid as int
Declare @cost as money
select @pid=ProductID,
@cost=standardCost from Deletedinsert into Temp values(@Pid,@cost,getdate())
select 'sorry you can not change the price of a product'
end
update Production.ProductCostHistory
set standardCost=55
where productID=707
(
ProductID int,
AttChangeCost money,
AttTime datetima
)
create trigger updtrigger on
Production.ProductCostHistory insert of UPdate
as
Begin
declare @Pid as int
Declare @cost as money
select @pid=ProductID,
@cost=standardCost from Deletedinsert into Temp values(@Pid,@cost,getdate())
select 'sorry you can not change the price of a product'
end
update Production.ProductCostHistory
set standardCost=55
where productID=707
No comments:
Post a Comment