Stored Procedures [rdld].[GetCustomerInfo ]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@CustomerNumbervarchar(15)15
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/****** Object:  StoredProcedure [rdld].[GetCustomerInfo] ******/
-- =============================================
-- Author:     Jeff Spindler
-- Date: 8/30/2021
-- Description:   Gets ABT PriKey for customer number
--                called at midnight
-- =============================================
CREATE PROCEDURE [rdld].[GetCustomerInfo ]
@CustomerNumber varchar(15)
AS
    BEGIN
        SET NOCOUNT ON;
        SET DEADLOCK_PRIORITY LOW;

        DECLARE    @return_value int,
        @outIsCustomerNumberValid bit;

        set @outIsCustomerNumberValid = isnull( ( select 1 from dbo.GetCustomerInformation_Synonym( @CustomerNumber ) ), 0 )

      -- IsCustomerNumberValid will be 1 if valid, 0 if not valid.  If you don't get
      -- the IsCustomerNumberValid column, that means the ABTPriKey would be valid, you
      -- would need to track that as this user's system is not yet up to this version.
      -- ABTPriKey will be -1 if ABTPriKey is obsolete (no longer used)
      SELECT
        CustomerNumber = @CustomerNumber,
        ABTPriKey = convert( int, -1 ),
        IsCustomerNumberValid = @outIsCustomerNumberValid
      for XML RAW;
      return @return_value;

    END;
GO
GRANT EXECUTE ON  [rdld].[GetCustomerInfo ] TO [MssExec]
GO
Uses