Possible Duplicate: How to SELECT * INTO [temp table] FROM [Stored Procedure]
I am new to T-SQL. I have a stored procedure that selects records. I want to query the records returned by the stored procedure, so I am trying to insert the records into a temporary table. (Stack Overflow posts and other posts say that is how to do it.)
But when I try, I get the error:
object or column name is missing or empty'
When I just run the stored procedure, I get a table that has columns with names.
select * into #temp1
exec alexander.dbo.get_uberrecords '20120101', '20120201', 'labcorp' //throws error saying columns must have names
but
exec alexander.dbo.get_uberrecords '20120101', '20120201', 'labcorp' // Returns cols with names
What am I missing?