Declare @modCode varchar(3)
SET @modCOde = 'SOR';
UPDATE Doc_SalesOrder
SET OLD_SP.Num = NEW_SP.NewNum
FROM Doc_SalesOrder as OLD_SP
INNER JOIN
(
Select
Id,
dbo.ApplyModuleCode(@modCode,Num) as NewNum
From Doc_SalesOrder
Where Num not LIKE '%'+@modCOde+'%'
)NEW_SP ON OLD_SP.Id = NEW_SP.Id
当我运行查询时,错误是:
无法绑定多部分标识符“OLD_SP.Num”。
为什么?