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 2008 Forums
 Transact-SQL (2008)
 Case statement

Author  Topic 

sandeep1209
Starting Member

6 Posts

Posted - 2012-03-16 : 05:18:13
Hi Friends,


I'm learning the dynamic SQL Server,
Any one can tell me what is the use of case statement and how we need to use case statement ?

Thank's,
Sandeep.

sandeep

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-16 : 05:35:17
Please read this for example and come back with questions:

http://msdn.microsoft.com/en-us/library/ms181765.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-16 : 11:27:18
what do you mean by 'dynamic SQL Server'? do you mean dynamic sql query?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

tom5235
Starting Member

1 Post

Posted - 2012-03-16 : 12:39:46
I found this great tool to access my database from anywhere. It runs on an android tablet or phone. It's called "Sql Server Mobile Manager" on the Android market https://play.google.com/store/apps/details?id=com.gen3.SqlServerMobileManager&feature=search_result#?t=W251bGwsMSwyLDEsImNvbS5nZW4zLlNxbFNlcnZlck1vYmlsZU1hbmFnZXIiXQ..

Awesome app. It will make you want to buy an android tablet!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-16 : 12:43:40
quote:
Originally posted by sandeep1209


Any one can tell me what is the use of case statement and how we need to use case statement ?



A CASE Statement allows you to handle logic conditions in a SQL Statement

LIKE

SELECT CASE WHEN Col = 1 THEN 'TRUE' ELSE 'FALSE' END AS TRUE_FALSE
FROM myTable99



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-16 : 14:45:33
i still remember the debate over whether CASE is a statement or an expression...

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -