Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Problem in View

$
0
0
I have a question regarding creating a view. Does the view name has to be something in the existing database? I got the following error when I create a view. Please help, thank you.

Create view
V_[I_DETAIL]
As
select Left([I_DETAIL].[CASTMONTH],4) As CASTYEAR ,Right([I_DETAIL].[CASTMONTH],2)As CASTMONTH
-- using CASE, if aired, make it equal to invoice
--if failed,make it equal to no invoice else NA
,case [I_DETAIL].[VSTATUS]
when 'Aired' then 'Yes'
when 'Failed' then 'No'
else 'Not Applicable'
end as [INVOICE]
FROM [Opt].[EDA.[I_DETAIL] as invoice_detail

Go

select * from V_[I_DETAIL]

go


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>