T
thefool
Unregistered / Unconfirmed
GUEST, unregistred user!
前台,我在delphi5中,用Tdbgrid对sql server7.0中的表进行修改。
后台,在修改触发器中想撤消对表中个别记录的修改,我该如何编写更新触发器?
比如:
create trigger tes_onupdate on tes for update as
declare curtes cursor for select * from deleted d inner join inserted i
on d.tesid=i.tesid
open curtes
fetch next from curtes
while @@fetch_status=0 begin
save tran savtran --在这保存不行吧?
....
if (...) begin
...
rollback savtran ---在这恢复事务看来也很无聊,到底该怎么办?
end
fetch next from curtes
end
close curtes
deallocate curtes
return
后台,在修改触发器中想撤消对表中个别记录的修改,我该如何编写更新触发器?
比如:
create trigger tes_onupdate on tes for update as
declare curtes cursor for select * from deleted d inner join inserted i
on d.tesid=i.tesid
open curtes
fetch next from curtes
while @@fetch_status=0 begin
save tran savtran --在这保存不行吧?
....
if (...) begin
...
rollback savtran ---在这恢复事务看来也很无聊,到底该怎么办?
end
fetch next from curtes
end
close curtes
deallocate curtes
return