SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--向ExamineAndApprove审批表中出发待审批的状态
CREATE trigger [dbo].[T_insert_ItemInfo]
on [dbo].[ItemInfo] for insert
as
begin transaction--准备修改
   declare @ItemId int
   set @ItemId=(select ItemId from inserted)
   if @ItemId>1
         begin
               insert into ExamineAndApprove (ItemId,EAAEstate)values(@ItemId,0)
         end
if @@error<>0
rollback transaction
else
commit transaction
Posted on 2009-09-15 21:49  邬江-远波  阅读(255)  评论(0编辑  收藏  举报