There is a problem with Rac2's solution. It's simple and straightforward, but it takes a monster performance hit.
This search method causes the query to use a table scan instead of an index lookup.
In the "where" line:
(@ignoreColA OR ColA = @searchValueForColA)
If "@ignoreColA" is false...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.