Views [dbo].[OrdersCustomer_Legacy]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created9:18:37 AM Wednesday, October 15, 2025
Last Modified9:19:02 AM Wednesday, October 15, 2025
Columns
Name
PriKey
CustomerJoinField
CustomerAddressJoinField
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
/**
* Don't use this view directly but instead use OrdersCustomer_Synonym.
* OrdersCustomer_Synonym will either point to this view or to
* OrdersCustomer_XLedger if that is active.
*/

create view [dbo].[OrdersCustomer_Legacy]
(
    -- Join to Orders.PriKey
    PriKey,
    -- Join to CustomerInformation_Synonym.CustomerJoinField
    CustomerJoinField,
    -- Join to CustomerAddressInformation_Synonym.CustomerAddressJoinField (along with CustomerJoinField)
    CustomerAddressJoinField
)
as
select
    PriKey = Orders.PriKey,
    CustomerJoinField = Orders.CustomerNumber,
    -- Orders.CustomerAddressCode is NULL (not '') when not specified and you can't join on a NULL!!
    CustomerAddressJoinField = isnull( Orders.CustomerAddressCode, '' )
from Orders
GO
GRANT SELECT ON  [dbo].[OrdersCustomer_Legacy] TO [MssExec]
GRANT INSERT ON  [dbo].[OrdersCustomer_Legacy] TO [MssExec]
GRANT DELETE ON  [dbo].[OrdersCustomer_Legacy] TO [MssExec]
GRANT UPDATE ON  [dbo].[OrdersCustomer_Legacy] TO [MssExec]
GO
Uses
Used By