
[dbo].[CustomerInformationWithDefaultAddress_Legacy]
create view [dbo].[CustomerInformationWithDefaultAddress_Legacy]
(
CustomerNumber,
CustomerName,
AddressCode,
OnHold,
NoCreditFlag,
CreditLimit,
Inactive,
CustomerClass,
[Address1],
[Address2],
[Address3],
City,
[State],
PostalCode,
Country,
CustomerId,
CustomerAddressId,
CustomerJoinField,
CustomerAddressJoinField,
Hold,
Contact,
TaxExempt
)
as
select
CustomerNumber = RM00101.CUSTNMBR,
CustomerName = RM00101.CUSTNAME,
AddressCode = RM00101.ADRSCODE,
OnHold = case
when RM00101.HOLD = 1 and RM00101.INACTIVE = 1 then 'On Hold, Inactive'
when RM00101.HOLD = 1 then 'On Hold'
when RM00101.INACTIVE = 1 then 'Inactive'
else ''
end,
NoCreditFlag = convert( bit, case when RM00101.CRLMTTYP = 0 then 1 else 0 end ),
CreditLimit = convert( money, RM00101.CRLMTAMT ),
Inactive = convert( bit, RM00101.INACTIVE ),
CustomerClass = RM00101.CUSTCLAS,
[Address1] = RM00101.ADDRESS1,
[Address2] = RM00101.ADDRESS2,
[Address3] = RM00101.ADDRESS3,
City = RM00101.City,
[State] = RM00101.[State],
PostalCode = RM00101.ZIP,
Country = RM00101.COUNTRY,
CustomerId = convert( int, null ),
CustomerAddressId = convert( int, null ),
CustomerJoinField = RM00101.CUSTNMBR,
CustomerAddressJoinField = RM00101.ADRSCODE,
Hold = convert( bit, RM00101.HOLD ),
Contact = RM00101.CNTCPRSN,
TaxExempt = RM00101.TAXEXMT1
from RM00101_Synonym as RM00101
GO
GRANT SELECT ON [dbo].[CustomerInformationWithDefaultAddress_Legacy] TO [MssExec]
GRANT INSERT ON [dbo].[CustomerInformationWithDefaultAddress_Legacy] TO [MssExec]
GRANT DELETE ON [dbo].[CustomerInformationWithDefaultAddress_Legacy] TO [MssExec]
GRANT UPDATE ON [dbo].[CustomerInformationWithDefaultAddress_Legacy] TO [MssExec]
GO