
[rdld].[CheckCustomerNumber]
CREATE PROCEDURE [rdld].[CheckCustomerNumber]
@inCustomerNumber varchar(15),
@inCustomerAddressCode varchar(15)
AS
BEGIN
SET NOCOUNT ON;
SET DEADLOCK_PRIORITY LOW;
DECLARE @customerNumberGood int;
set @customerNumberGood = isnull( ( select 1 from dbo.GetCustomerAddressInformation_Synonym( @inCustomerNumber, isnull(@inCustomerAddressCode, '') ) ), 0 );
if(@customerNumberGood = 1)
BEGIN
select 0 as ErrorCode, 'Customer Number good' as ErrorMessage for xml RAW;
END
ELSE
BEGIN
select 1 as ErrorCode, 'Customer Number, Address Code ' + @inCustomerNumber + ', ' + @inCustomerAddressCode + ' not found' as ErrorMessage for xml RAW;
END
END
GO
GRANT EXECUTE ON [rdld].[CheckCustomerNumber] TO [MssExec]
GO