Stored Procedures [dbo].[MssWebGetOrderCustomerContacts]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOrderIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
create procedure [dbo].[MssWebGetOrderCustomerContacts]
    @inOrderId int
as
    select
        PhoneType = OrderPhoneType.TypeName,
        DisplayPhone = dbo.GetFormattedPhoneNumber(
            OrderPhoneNumber.CountryCodeStandardFID,
            OrderPhoneNumber.AreaCode, OrderPhoneNumber.LocalNumber),
        CountryCode = CountryCodeStandard.PhoneCountryCode,
        AreaCode = OrderPhoneNumber.AreaCode,
        LocalNumber = OrderPhoneNumber.LocalNumber
    from OrderPhoneNumber
    inner join OrderPhoneType on
        OrderPhoneNumber.OrderPhoneTypeFID = OrderPhoneType.OrderPhoneTypeID and
        OrderPhoneType.IsShipperPhoneType = 1
    left outer join CountryCodeStandard on OrderPhoneNumber.CountryCodeStandardFID = CountryCodeStandard.CountryCodeStandardID
    where OrderPhoneNumber.OrderFID = @inOrderId
GO
GRANT EXECUTE ON  [dbo].[MssWebGetOrderCustomerContacts] TO [MssExec]
GO
Uses