[dbo].[MssWebGetOrderCustomerContacts]
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