Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I put results from a proc into table 2

Status
Not open for further replies.

mjp483

Programmer
Apr 27, 2004
42
US
I need to run a proc, and be able to insert the results into a tmp table to work with.....the catch is...I don't have access to change or open the sproc, just run it in query anylyzer and see the result.....Any ideas..
 
Select into TableA (col1, col2, col3,col4) exec Procname


And the column list is important.


Rob
 
You could also do this with Insert/exec.

Create Table #Temp(Field1 as Integer, Field2 As VarChar(20))
Insert into #Temp Exec ProcedureName


Unfortunately, it would appear that you have to use a 'real' table or a temp table. I prefer using table variables in most of my sprocs because I find that performance is a little better (depending on data). You cannot use table variable in this case.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
What george says..

I ment to specify "insert" and what came out was "Select" - I am pretty certain Select won't work.

Rob
 
Awesome, I didn't know it was possible.....until I tried it...awesome thanks for all your responses...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top