1,481 total views, 2 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]