SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Bibie_01] ON [dbo].[ICStockBillEntry]
FOR Update
AS
BEGIN
update ICStockBillEntry set FConsignPrice=t2.FConsignPrice*t4.FExchangeRate,FConsignAmount=(t2.FConsignPrice*t4.FExchangeRate)*t2.FQty
from ICStockBill t1 inner join
ICStockBillEntry t2 on t1.FInterID=t2.FInterID inner join
t_Organization t3 on t1.FSupplyID=t3.FItemID inner join
t_Currency t4 on t3.FCyID=t4.FCurrencyID
where t1.FSupplyID='12826' and
t1.FTranType='21'
ICStockBillEntry 表的欄位如下:

ICStockBill 表的欄位如下:

想寫個觸發器,只更新ICStockBill 表中當前單據編號的資料,不更新所有ICStockBill表的資料
uj5u.com熱心網友回復:
把inner join ICStockBillEntry改成inner join inserteduj5u.com熱心網友回復:
有沒有大佬在啊!轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/105994.html
標籤:疑難問題
