|
-
Nov 12th, 2006, 10:13 PM
#6
Re: How I build my SQL strings
 Originally Posted by disruptivehair
We can't use simple filters like that because the where clause could be absent, it could be followed by an AND clause, or it could not be...
That sin't a problem though... One trick you can use is to permanently add to your select statement the following where clause:
Select...
From...
Where 1=1
All you have to do now is add as many additional ANDs as you can possibly need.
You can build all of your filters in the fron end and pass it to SP and then append it at the end of sql (after 1=1).
I actually agree with your DBA - multiple if-else make SP run slower. Just instead of "disallowing" he should help you to tune it up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|