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