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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Case clause issue

Author  Topic 

anoopjmj
Starting Member

1 Post

Posted - 2009-12-04 : 04:46:17
can i use two value for CASE instead of checking one value.

eg @a= and @b equal one soem value retrun specfic result

thnaks in advancee

Anoop

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-12-04 : 04:50:29
yes
select case when id = @id and name = @name then 1 else 0 end
from tablename
Go to Top of Page

creieru
Starting Member

12 Posts

Posted - 2009-12-04 : 04:53:23
syntax of case statement:
case when @condition then @return_value1 else @return_value2 end.

eg: case when @a=??? and @b=???? then @return_value1 end
Go to Top of Page
   

- Advertisement -