1
我想請輸入以下命令QuoteItem的UPDATE觸發器:需要使用SQL幫助加入一個功能
UPDATE QuoteItem
SET List = StyleItem.List, CostFactor = StyleItem.CostFactor, Cost = NULL
FROM dbo.fn_GetQuoteItemListPrice(QuoteItem.ItemId, QuoteItem.RoomId)
AS StyleItem
CROSS JOIN (QuoteItem JOIN INSERTED ON
QuoteItem.QuoteItemId = INSERTED.QuoteItemId)
WHERE (INSERTED.List IS NULL) AND (INSERTED.ItemId IS NOT NULL)
我得到follwoing錯誤:
Msg 4104, Level 16, State 1, Procedure QuoteItem_UPDATE, Line 6
The multi-part identifier "QuoteItem.ItemId" could not be bound.
Msg 4104, Level 16, State 1, Procedure QuoteItem_UPDATE, Line 6
The multi-part identifier "QuoteItem.RoomId" could not be bound.
消息102,級別15,狀態1,過程QuoteItem_UPDATE 13行 附近有語法錯誤 'XX'。 – Shimmy 2009-12-11 04:35:58
對不起,我沒有打開SQL,但嘗試在xx – Sparky 2009-12-11 04:54:19
之後添加ON 1 = 1另外,爲什麼需要交叉連接,您是否可以不直接從INSERTED表中引用ItemID和RoomId? – Sparky 2009-12-11 04:57:51