我想要实现修改orders的p_name时,product的p_name也更新了,我这样写问题在那里
drop trigger upord
go
create trigger upord on orders
after update
as
declare @row int
set @row = @@rowcount
if @row = 0
return
if (update(p_name))
begin
if @row > 1
begin
rollback transaction
raiserror('you can only one information at one time',16,1)
end
return
update p set p.p_name = i.p_name from product p,inserted i,deleted d where p.p_name = d.p_name
end
我想要实现修改orders的p_name时,product的p_name也更新了,我这样写问题在那里?