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

CREATE trigger [dbo].[mps_flowworkstatus_data_delete] on dbo.mps_flowworkstatus_data for delete as
begin
    declare
       @numrows  int,
       @errno    int,
       @errmsg   varchar(255)

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

    return

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