[dbo].[vCustomerInformation]
CREATE view [dbo].[vCustomerInformation]
(
CustomerNumber,
CustomerName,
OnHold,
NoCreditFlag,
CreditLimit,
Inactive,
CustomerClass,
[Address],
City,
[State]
)
as
select
CustomerNumber = Customer.CUSTNMBR,
CustomerName = ltrim( rtrim( Customer.CUSTNAME ) ),
OnHold = case
when Customer.HOLD = 1 and Customer.INACTIVE = 1 then 'On Hold, Inactive'
when Customer.HOLD = 1 then 'On Hold'
when Customer.INACTIVE = 1 then 'Inactive'
else ''
end,
NoCreditFlag = case when Customer.CRLMTTYP = 0 then 1 else 0 end,
CreditLimit = Customer.CRLMTAMT,
Inactive = Customer.INACTIVE,
CustomerClass = Customer.CUSTCLAS,
[Address] = Customer.[Address1],
City = Customer.City,
[State] = Customer.[State]
from RM00101_Synonym as Customer
GO
GRANT SELECT ON [dbo].[vCustomerInformation] TO [MssExec]
GRANT INSERT ON [dbo].[vCustomerInformation] TO [MssExec]
GRANT DELETE ON [dbo].[vCustomerInformation] TO [MssExec]
GRANT UPDATE ON [dbo].[vCustomerInformation] TO [MssExec]
GO