无法绑定由多个部分组成的标识符
时间:2010-12-15 来源:dzt_tomdu
CREATE TRIGGER TR_2 ON BeginTran for insert
as
begin
update MotorInfo
set MotorInfo.CCCS = MotorInfo.CCCS +1
where MotorInfo.MotorNo = inserted.MotorNum
end
错误原因:无法绑定由多个部分组成的标识符"inserted.MotorNum"
解决方法一:
将inserted.MotorNum改为 select MotorNum from inserted
方法二: 给inserted起个别名
CREATE TRIGGER TR_2 ON BeginTran for insert
as
begin
update MotorInfo
set MotorInfo.CCCS = MotorInfo.CCCS +1
from inserted i
where MotorInfo.MotorNo = i.MotorNum
end
相关阅读 更多 +