Sybase的Trigger事件(rollback)

 1,858 total views,  1 views today

原文: SyBooks Online
原來Sybase 也可以做條件試的 rollback
[sql]create trigger t1
on titleauthor
for insert as
if (select count(*)
from titles, inserted
where titles.title_id = inserted.title_id) = 0
begin
print “Please put the book’s title_id in the
titles table first.”
rollback transaction
end
[/sql]

發表迴響

%d 位部落客按了讚: