You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/word/新协航_设计文档/数据库建表文档/1.0/sMsSysAfterDelete.sql

62 lines
1.6 KiB
Transact-SQL

/****** Object: StoredProcedure [dbo].[sMsSysAfterDelete] Script Date: 10/22/2013 13:41:05 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sMsSysAfterDelete]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[sMsSysAfterDelete]
GO
/****** Object: StoredProcedure [dbo].[sMsSysAfterDelete] Script Date: 10/22/2013 13:41:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[sMsSysAfterDelete]
(@ps_BillNo varchar(40),
@ps_YwType varchar(4),
@ps_UserCode varchar(10),
@ps_UserName varchar(150),
@pi_Result int output,
@ps_Message varchar(2000) output
)
--WITH ENCRYPTION
AS
declare @vi_RtnValue integer
Begin
/*=================初始化变量=================*/
SET NOCOUNT ON;
set @pi_Result=-1
set @ps_Message='开始删除后处理'
BEGIN TRY
/*=================删除后处理=================*/
if(@ps_YwType = '0111') --派车单
begin
exec @vi_RtnValue = sMsWlPcAfterDelete @ps_BillNo, @ps_UserCode, @ps_UserName, @pi_Result output, @ps_Message output
if @vi_RtnValue <> 1 return (@vi_RtnValue)
end
if(@ps_YwType = 'Import_main') --删除合同信息后,删除其下的商品、商品的许可证使用、库存
begin
exec @vi_RtnValue = sMsXXHMainAfterDelete @ps_BillNo, @ps_UserCode, @ps_UserName, @pi_Result output, @ps_Message output
if @vi_RtnValue <> 1 return (@vi_RtnValue)
end
/*=================成功=================*/
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