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
 case statement help needed

Author  Topic 

smithani
Starting Member

42 Posts

Posted - 2007-08-14 : 15:27:01
Hi,
here is what i am trying to do, when @call=2, then use table1.call
else use table2.call
and get syntax error no matter what I try,

case @services=2 then table1.call else table2.call end

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-14 : 16:17:36
case WHEN @services=2 then table1.call else table2.call end


Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-08-14 : 16:29:46
You should get in the habit of looking up the syntax of statements in SQL Server Books Online when you get a syntax error.





CODO ERGO SUM
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-14 : 16:55:44
Well Said Michael.

Ashley Rhodes
Go to Top of Page
   

- Advertisement -