July 16, 2009 at 4:10 am
I have 20 input parameters in a stored procedure and all are optional, but when given values from the UI, it should included in condition otherwise not. It looks like this.
[font="Courier New"]SELECT * FROM TABLES
WHERE
(Table.Col1 BETWEEN @C1 AND @C2) AND
(Table.Col2 BETWEEN @C3 AND @C4) AND
(Table.Col3 BETWEEN @C5 AND @C6) [/font]
How to handle this situation, Any idea please?
July 16, 2009 at 4:14 am
Have a look here
http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537July 17, 2009 at 12:08 am
Thanks Mark,
I got it.
Thanks for your help. 🙂
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply