1
另一個表我是新來觸發 我有名字ArefSms而tblSalesProd觸發更新條件
後,我想插入我的觸發更新ArefSms其中tblSalesProd.SalesID = ArefSms.SalesID 爲此提出兩個表我下面寫的代碼
USE [ACEDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[areftblSalesProd] ON [dbo].[tblSalesProd]
AFTER INSERT
AS
Begin Try
Update ArefSms
set
qt=inserted.ProdQty
where ArefSms.SalesID=inserted.SalesID
End Try
Begin Catch
End catch
,但現在我有錯誤
Msg 4104, Level 16, State 1, Procedure areftblSalesProd, Line 9
The multi-part identifier "inserted.SalesID" could not be bound.
我能做些什麼?
感謝這是我的答案 –