创建触发器时出错,大家帮忙看看错在哪。谢谢
create trigger tjy_delete on jy
for delete as
begin
update xs
set 借书量=借书量-1
where xs.借书证号 in
(select deleted.借书证号
from deleted)
update book
set 库存量=库存量+1
where book.isbn in
(select deleted.isbn
from deleted)
end
错误提示:服务器: 消息 170,级别 15,状态 1,过程 tjy_delete,行 6
第 6 行: ' ' 附近有语法错误。
服务器: 消息 170,级别 15,状态 1,过程 tjy_delete,行 8
第 8 行: ' ' 附近有语法错误。
------解决方案--------------------create trigger tjy_delete on jy
for delete as
begin
update xs
set 借书量=借书量-1 where xs.借书证号 in (select deleted.借书证号 from deleted)
update book
set 库存量=库存量+1 where book.isbn in (select deleted.isbn from deleted)
end
这样也可以
代码没有问题,应该是分隔符的问题