Stored Procedures [dbo].[MssWebGetOrderSakariCustomerContacts]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inOrderIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
create procedure [dbo].[MssWebGetOrderSakariCustomerContacts]
    @inOrderId int
as
begin
set nocount on
    select
        PhoneType = OrderPhoneType.TypeName,
        CountryCode = isnull(CountryCodeStandard.PhoneCountryCode,DefaultCountryCode.PhoneCountryCode),
        CountryCodeStandardId = isnull(CountryCodeStandard.CountryCodeStandardID, DefaultCountryCode.CountryCodeStandardID),
        AreaCode = OrderPhoneNumber.AreaCode,
        LocalNumber = OrderPhoneNumber.LocalNumber
    from OrderPhoneNumber
    cross join dbo.getDefaultCountry() as DefaultCountryCode
    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
end;
GO
GRANT EXECUTE ON  [dbo].[MssWebGetOrderSakariCustomerContacts] TO [MssExec]
GO
Uses