/****** Object: StoredProcedure [dbo].[sMsXXHMainAfterDelete] Script Date: 10/22/2013 13:50:35 ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sMsXXHMainAfterDelete]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[sMsXXHMainAfterDelete] GO /****** Object: StoredProcedure [dbo].[sMsXXHMainAfterDelete] Script Date: 10/22/2013 13:50:35 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[sMsXXHMainAfterDelete] (@ps_BillNo varchar(40), @ps_UserCode varchar(10), @ps_UserName varchar(150), @pi_Result int output, @ps_Message varchar(2000) output ) --WITH ENCRYPTION AS declare @vi_RtnValue integer declare @vs_PcBillType varchar(10) declare @vs_BillStatus varchar(10) declare @vs_BulkBillNo varchar(40) declare @vi_Count integer Begin /*=================初始化变量=================*/ SET NOCOUNT ON; set @pi_Result=-1 set @ps_Message='开始合同删除后处理' BEGIN TRY /*=================删除后处理=================*/ delete from import_cargo where contractno=@ps_BillNo delete from import_appstate where contractno=@ps_BillNo delete from import_KC where contractno=@ps_BillNo /*=================成功=================*/ set @pi_Result=1 set @ps_Message='删除后处理成功' return(1) /*=================异常处理=================*/ END TRY BEGIN CATCH Set @pi_Result=-1 Set @ps_Message='合同删除后处理失败' return(-1) END CATCH End GO