Table-valued Functions [dbo].[GetCustomerAddressInformation_XLedger]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inCustNumbervarchar(15)15
@inAddressCodevarchar(15)15
Permissions
TypeActionOwning Principal
GrantSelectMssExec
SQL Script
/*
*    Creates a table function for finding customer address information by CustomerNumber and AddressCode that does an
*    index seek no matter which customer data source is used.
*    The GetCustomerAddressInformation_Synonym will be set to use the appropriate function for the current
*    system, based upon if they have XLedger, GP, QuickBooks or no accounting system.
*
*/

create function [dbo].[GetCustomerAddressInformation_XLedger]( @inCustNumber varchar(15), @inAddressCode varchar(15) )
returns table as
    return (
        select *
        from CustomerAddressInformation_Synonym
        where CustomerNumber = @inCustNumber and
            AddressCode = isnull( @inAddressCode, '' )
    )
GO
GRANT SELECT ON  [dbo].[GetCustomerAddressInformation_XLedger] TO [MssExec]
GO
Uses