[thelist] MSSQL Stored Proc problem

Steve Lewis slewis at macrovista.net
Fri Jan 3 15:19:01 CST 2003

I am trying to write a stored proc that will perform statistical
analysis on the responses to an online survey.  In particular I need to
collect an average and response count on a non-contiguous response set
of variable size. That is to say:

I need to
SELECT /* stuff */
FROM a_view
WHERE question_number IN (/* this could be four items, or fourteen */)
AND /* a few other conditions that identify the questionaire, and the
user group, etc */

question_number is type FLOAT
(there are non-integer question numbers, don't ask)

How can I pass the variable-length list of question_numbers to the
stored proc?  We have looked at installing some User-Defined functions
to support 'lists' but we are quite reluctant to do so.  This sp will be
called several times per report with a different IN() list and we would
really like to have a solid sp for performance reasons.



More information about the thelist mailing list