alter trigger [TriggerName] on [table]
for(after) insert(update delete)
as
sql语句
例:
create
alter trigger Borrow_Insert on Borrow
for insert
as
declare @count int
select @count=BookCount from Book
where BookId=(select BookId from inserted)
if(@count>0)
update Book Set BookCount=BookCount-1
where BookId=(select BookId from inserted)
else
rollback tran