[dbo].[InternationalCarrierAddresses]
SET QUOTED_IDENTIFIER OFF
GO
CREATE view [dbo].[InternationalCarrierAddresses]
(
InternationalCarrierFID,
Address,
City,
State,
CountryCodeStandardFID,
PostalCode
)
as
select
InternationalCarrierFID = InternationalCarrier.InternationalCarrierID,
Address = dbo.BuildAddressFromAddressParts
(
InternationalCarrierAddress.Address1,
InternationalCarrierAddress.Address2,
InternationalCarrierAddress.Address3
),
City = InternationalCarrierAddress.City,
State = InternationalCarrierAddress.State,
CountryCodeStandardFID = InternationalCarrierAddress.CountryCodeStandardFID,
PostalCode = InternationalCarrierAddress.PostalCode
from InternationalCarrier
left outer join AddressType on AddressType.TypeName = 'Main'
left outer join InternationalCarrierAddress on
(
InternationalCarrier.InternationalCarrierID = InternationalCarrierAddress.InternationalCarrierFID and
AddressType.AddressTypeID = InternationalCarrierAddress.AddressTypeFID
)
GO
GRANT SELECT ON [dbo].[InternationalCarrierAddresses] TO [MssExec]
GRANT INSERT ON [dbo].[InternationalCarrierAddresses] TO [MssExec]
GRANT DELETE ON [dbo].[InternationalCarrierAddresses] TO [MssExec]
GRANT UPDATE ON [dbo].[InternationalCarrierAddresses] TO [MssExec]
GO