Re: ASP - Stored Procedure best practice?



J (IDontLikeSpam@xxxxxxxxxxx) writes:
Do you know of a recommended method in doing this for a form with multiple
fields which allows a user to specify more criteria on multiple fields?
Seems like building the dynamic sql statement in the stored procedure with
the specified field parameters is the only method I can think of to do
multiple criteria searching but I guess I still would like to avoid.

I discuss a whole bunch of solutions in both dynamic and static SQL, as
well as some very interesting hybrids in an article on my web site:
http://www.sommarskog.se/dyn-search.html.

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: SQL queries that have parameters passed by user
    ... Erland Sommarskog wrote: ... >> several fields and filters on a criteria that I would like to be user ... >> The query works fine in MS SQL and seems to be fairly quick, ...
    (comp.databases.ms-sqlserver)
  • Re: SQL Syntax Error
    ... match all the criteria you input. ... SQL view and never open it in the query grid view. ... The syntax for the "where" statement is incorrect becuase of this. ...
    (microsoft.public.access.queries)
  • Re: QueryTables - Retrieving Data
    ... data in Excel then filter it using cell formulas, pass your criteria ... ('sql datasource' is particularly vague; if you mean SQL Server then ... The column has an eight digit account code that I need to ... When I 'double click' a cell in the accountnumber ...
    (microsoft.public.excel.misc)
  • Re: time criteria in query
    ... Prove me wrong by providing the SQL ... Or...start a query with just the date field ... criteria, it does actually return the time value properly. ... SQL Server with ODBC, Access should use DAO and therefore require the ...
    (microsoft.public.access.queries)
  • RE: Complex query criteria - desperate appeal
    ... It should result in a much simpler sql statement because you won't ... appropriate SQL string if it is not. ... that you may not be able to change the sql of a query that is ... criteria in text fields, you would have to modify these somewhat to give the ...
    (microsoft.public.access.queries)