Since the column ProductID
is present in both tables, the WHERE
clause find it Ambiguous. So,
Replace ProductID=@ProductID
with o.ProductID=@ProductID
update o set o.Updatedproduct = p.ProductQuantity - o.Totalproduct
from CustomerProducts o
inner join Products p
on o.ProductID = p.ProductID WHERE o.ProductID=@ProductID
15
solved Ambiguous column name ‘ProductID’ in asp.net