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