0

我试图在条件发生时插入一个值,但它给了我错误 ambiguos 列名,代码是:

create trigger B
on ALUNOS
after update, insert
as 
begin 
update ALUNOS
set média_final = 9 from inserted where média_final < 9
end  
4

2 回答 2

0

try to follow this

update table set column = value where column = value

change value for the value that you want, you can add null or change null, don`t ever forget '' for string and lose it for numbers

于 2013-06-01T02:06:31.127 回答
0
create trigger B
on ALUNOS
after update, insert
as 
begin 
update ALUNOS
set média_final = 9 
from inserted i where i.média_final < 9
end  

模棱两可的列是 média_final,它在两个表中。指定它来自哪个表是您需要做的。

于 2013-05-31T19:11:30.193 回答