Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Location
    Milwaukee, WI
    Posts
    105

    Unanswered: How Query Question

    I have a form where users pick multiple values. I then want to run a query against the Sql Server backend and limit the result set based on the multiple picks the user just made.

    IF those picks were in a 2nd table - it would look like:

    Select * from firsttable join secondtable on firsttable_pk=secondtable_fk

    The problem is that this hypothetical 2nd table would be local to the application, not on the back end.

    I could store those pick in an Array, but not sure if that can be passed to the back end for use in a query.

    Any suggestions?

    Thanks,

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I've solved this problem in the past by inserting the selected values into a SQL Server #Temp table, and then joining to that table in my select statement. This works as long as each user has their own connection.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2005
    Location
    Milwaukee, WI
    Posts
    105
    Thanks blindman. I'll check BOL for the #TEMP table and give it a try. Each user will have their own connection.

  4. #4
    Join Date
    Aug 2005
    Location
    D/FW, Texas, USA
    Posts
    78
    I've also used a User Defined Function for a similar purpose. I pass in a list of values separated by commas and then a UDF to parse them into a table. Then you can join to that.

    Here is a link to one possible version of the ParseString Function: http://www.codeproject.com/database/...e_a_String.asp
    --wayne
    SELECT * FROM Users WHERE Clue>0
    0 rows returned

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •