I want to insert the results of a stored procedure directly into a temp table. Is there a way to do that without first declaring the temp table? Using TSQL, you can do it like this;
select field1, field2, field3
into #table
from tablename
If I try to do this:
exec storedprocname param1, param2
into #table
I get "Incorrect syntax near keyword 'into'"
I would rather save some code, and not declare the tables, if I don't have to. Any ideas? Thanks in advance.
select field1, field2, field3
into #table
from tablename
If I try to do this:
exec storedprocname param1, param2
into #table
I get "Incorrect syntax near keyword 'into'"
I would rather save some code, and not declare the tables, if I don't have to. Any ideas? Thanks in advance.