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
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