July 25, 2012 at 1:08 am
Seriously, don't do this. That's the best thing I can recommend. This kind of design is incredibly problematic.
If you absolutely must, you need to use dynamic SQL and protect against SQL Injection.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 25, 2012 at 1:15 am
i solve it
http://brentedwards.net/2009/01/05/dynamic-where-clause-with-sql-server-stored-procedure/
is fantastic.
July 25, 2012 at 1:31 am
barua.99 (7/25/2012)
i solve ithttp://brentedwards.net/2009/01/05/dynamic-where-clause-with-sql-server-stored-procedure/
is fantastic.
Sure, as long as good performance is not a requirement. Those catch-all style queries are horridly slow in many cases.
http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply