为什么弹出----错误207:列名'客户编号'无效?CREATE TRIGGER insertgoods ON ordergoods
AFTER INSERT
As
begin
declare
@goodstotal money,
@postagetotal money
select @goodstotal = sum(数量*价格) from ordergoods
where 客户编号 = (select 客户编号 from inserted)
select @postagetotal = sum(数量*邮费) from ordergoods
where 客户编号 = (select 客户编号 from inserted)
update customers set
商品总价 = @goodstotal,
邮费总价 = @postagetotal,
总价 = @goodstotal + @postagetotal
where 客户编号 = (select 客户编号 from inserted)
end使用“select 客户编号 from ordergoods”能查到此列
AFTER INSERT
As
begin
declare
@goodstotal money,
@postagetotal money
select @goodstotal = sum(数量*价格) from ordergoods
where 客户编号 = (select 客户编号 from inserted)
select @postagetotal = sum(数量*邮费) from ordergoods
where 客户编号 = (select 客户编号 from inserted)
update customers set
商品总价 = @goodstotal,
邮费总价 = @postagetotal,
总价 = @goodstotal + @postagetotal
where 客户编号 = (select 客户编号 from inserted)
end使用“select 客户编号 from ordergoods”能查到此列
select top 1 客户编号 from customers
select top 1 客户编号 from customers
后显示:服务器: 消息 207,级别 16,状态 3,行 1
列名 '客户编号' 无效。
"customers"表中没有有字段名为"客户编号"