Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 view

Author  Topic 

asm
Posting Yak Master

140 Posts

Posted - 2005-10-31 : 01:07:11
Hi

How can i save a query as a view if query contains the case statement


asm

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-31 : 01:10:07
What is the problem you are facing?

Try this

Create View yourView
as
Select Case....end as yourCol from yourTable

Otherwise post the query you used

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-10-31 : 01:56:33
make sure the column name or alias used in your select statement are not the same when creating view. And also you can't have a empty col name. For example your case .. end statement. You need to assign an alias to it

As view is an object in DB. The column name of the obj cannot be duplicate

[KH]
Go to Top of Page
   

- Advertisement -