Tuesday, March 27, 2012

CASE statement

Hello,
I created a view in SQL Server Express 2005 that contained CASE END
statements.
I use this view in a .NET 2005 project, which works fine on my machine.
When I deploy my project to a machine that is running SQL Server 200, I get
the following error:
The Query Designer does not support the CASE SQL contruct.
Any way around this'
TIA,
Amber"amber" <amber@.discussions.microsoft.com> wrote in message
news:C5E9214E-628F-4CC3-8CC4-4DD7A5347999@.microsoft.com...
> Hello,
> I created a view in SQL Server Express 2005 that contained CASE END
> statements.
> I use this view in a .NET 2005 project, which works fine on my machine.
> When I deploy my project to a machine that is running SQL Server 200, I
> get
> the following error:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>
If you could include the CASE statement that you used, and any other
relevant DDL we could be more helpful.
Rick Sawtell|||Which SQL 200x? :) 2000 or 2005?
The way around this: don't use the Query Designer. Script it and run the
code in Query Analyzer.
amber wrote:
> Hello,
> I created a view in SQL Server Express 2005 that contained CASE END
> statements.
> I use this view in a .NET 2005 project, which works fine on my machine.
> When I deploy my project to a machine that is running SQL Server 200, I ge
t
> the following error:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>|||"amber" wrote:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>
Yes. Learn to write SQL instead of using the Query Designer. The designer is
a crutch that will do you know favours in the long run. If you want to use
anything more than very basic stuff then you must avoid it.
David Portas
SQL Server MVP
--

No comments:

Post a Comment