Home Forums SQL Server 7,2000 T-SQL using "IN" in my query ... suggestions? RE: using "IN" in my query ... suggestions?

  • With the number of id's you are suggesting, I don't think there is an easy way. As already mentioned above the use of IN should be avoided. Passing the list to the proc would be difficult as well due to the 8k varchar limit unless you use text.

    What I suggest is

    1. create a control table to hold latestid

    2. write a proc that updates latestid and returns it

    3. create a permanent table (selectedid) containing recid (from latestid returned above) and paramid.

    4. create a proc to store recid,paramid in the table

    5. in the app use the procs above to create the selection id's

    6. change your proc to join to this table (selectedid)

    7. write an use a proc to delete the id's from the selectedid table

    No idea of performance.

    Far away is close at hand in the images of elsewhere.
    Anon.