Need an Alternative for Case statement for my Stored proc in SQL server 2005
-
Tuesday, November 20, 2012 10:37 AM
Hi, I need an Alternative for Case statement in SQL server 2005, as my stored procedure creates a dynamic select query.
Thanks in Advance.
All Replies
-
Tuesday, November 20, 2012 10:38 AMAnswerer
Read Erland's articles
http://www.sommarskog.se/dynamic_sql.html
http://www.sommarskog.se/dyn-search.html
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Blog: Large scale of database and data cleansing
MS SQL Consultants: Improves MS SQL Database Performance
- Proposed As Answer by Naomi NMicrosoft Community Contributor, Moderator Wednesday, November 21, 2012 3:07 AM
-
Tuesday, November 20, 2012 11:12 AM
IF..Else condition may help you
For more about IF..Else see below URL
http://msdn.microsoft.com/en-us/library/ms182717.aspx
IF you use SQL 2012,then IIF will be helpful to you
For more about IIF see below URL
http://msdn.microsoft.com/en-us/library/hh213574.aspx
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
-
Tuesday, November 20, 2012 11:18 AM
Hi,
You can use IF...ELSE as alternate .To know see below:
http://sqltutorials.blogspot.com/2007/06/sql-ifelse-statement.html
Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/
-
Wednesday, November 21, 2012 8:23 AM
Any updates?
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

