views:

14

answers:

1

I have an sp named 'FolderSttructure'.It returns the following result -

FolderID

1 2 3 4

I have to call the above sp 'FolderSttructure' inside another sp named 'SearchFolder' and insert the result of first sp in to a temperory table.

Is it possible?

If yes how can we do that?

+2  A: 

Yse, you can do it like this:

CREATE TABLE #ATempTable
(
FolderID INTEGER
)

INSERT #ATempTable
EXECUTE FolderSttructure
...
AdaTheDev
+1 Beat me to the punch!1 :-) Just one thing, the temp table must be exact match of whatever the SP returns. In this case, i think the FolderID may not be an integer. In his example it Looks like a string "1 2 3 4" maybe of concatenated values. Or maybe its just misleading formatting
InSane