I'm actually a multimedia programmer, so use small words. :-)

I have a simulation engine that requests varying question sets via the querystring e.g.:

taskdesc.asp?process=7&main_path=c2k&scene_path=60 02,6002,5002

Here is the stored procedure it calls: (don't laugh too hard, it was my first SP)

CREATE PROCEDURE dbo.pd_getse2qsetdata @param1 varchar(50), @param2 varchar(500) AS
BEGIN
DECLARE @TEMPVAR varchar(600)
SET @TEMPVAR =
'SELECT qset_xml
FROM tbl_task_data
WHERE main_path=(''' + @param1 + ''') AND task_path IN (' + @param2 + ')'
EXEC(@TEMPVAR)
END
GO


Question:

I want the question set data returned in the order requested, and duplicated if asked for more than once.
E.g the query above returns:

<question menuid="1002" taskid="5002" task="Entering a New Lead" scoredactions="9" weight="100" />
<question menuid="5120" taskid="6002" task="Posting Financial Aid Disbursements" scoredactions="11" weight="25" />

But I want

<question menuid="5120" taskid="6002" task="Posting Financial Aid Disbursements" scoredactions="11" weight="25" />
<question menuid="5120" taskid="6002" task="Posting Financial Aid Disbursements" scoredactions="11" weight="25" />
<question menuid="1002" taskid="5002" task="Entering a New Lead" scoredactions="9" weight="100" />
</questiondefs>


Any suggestions welcome.

Thanks

Dave