Home Forums SQL Server 2005 T-SQL (SS2K5) Select from stored proc for many records where single record ID being passed in RE: Select from stored proc for many records where single record ID being passed in

  • Hi Chella,

    Please excuse me if I appear dense here...

    It looks like you end up with a table variable, I don't think TVs can be passed in to a Sproc, at least not in SQL2005.. Am I missing something?

    I need to solve for this

    INSERT INTO #tempTable (recordID, attribute1, attribute2, attribute3 etc...)

    exec mysproc x

    Where x is a single existing non sequential record ID passed in. If I specify x explicitly like - exec mysproc 1234 - I will get one row in the temp table.. which is great, except that I need rows in the temp table for thousands of records.

    So the problem is how to pass those thousands of existing record IDs in to myexistingsproc for the insert given that the sproc can not consume more than one record ID parameter passed in at a time..

    Thanks to anyone who can help me understand how to get from here to there.. :blink: