IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_biztype_decision_insert]') AND type = 'TR')
DROP TRIGGER [dbo].[mps_biztype_decision_insert]
GO

   

CREATE trigger [dbo].[mps_biztype_decision_insert] on [dbo].[mps_biztype_decision] for insert as
begin
    declare
       @maxcard  int,
       @numrows  int,
       @numnull  int,
       @errno    int,
       @errmsg   varchar(255)

    select  @numrows = @@rowcount
    if @numrows = 0
       return

 update mps_biztype set biz_changed = 0  from inserted  where bd_bizid=biz_id 
    return

/*  Errors handling  */
error:
    -- raiserror @errno @errmsg
    rollback  transaction
end