Friday, February 24, 2012

how can i use a conditional where clause in sql statment

I have a store procedure where i need to use conditionel where clause

One possibility would be to make the conditional parameter nullable and then add an IsNull check to your where clause that only evaluates the condition when the parameter is set.|||

hi

you can use coalesce function to implement conditional where clause in sql statement.

for more details please refer this link

http://www.sqlteam.com/item.asp?ItemID=2077

regards

No comments:

Post a Comment