34,587
社区成员
发帖
与我相关
我的任务
分享
ALTER TRIGGER Trigger_Update_PRODUCTINFO
ON [dbo].[PRODUCTINFO]
FOR UPDATE
AS
BEGIN
--定义所需变量
declare
@productId nvarchar(255),
@productName nvarchar(255)
--获取更新后的数据
select @productId = id,
@productName = productname
from inserted;
--更新库存商品信息
update bcs_ProductInfoStore
set productName = @productName,
where productID = @productId
END
GO
begin
update A
set A.productName = B.productName
from bcs_ProductInfoStore A , inserted B
where A.productID = B.productId
end