Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 insert into a temp table

Author  Topic 

BendJoe
Posting Yak Master

128 Posts

Posted - 2008-10-09 : 11:52:31
insert into #Table Exec(@SQL);

This is giving #Table invalid object error.

I need to populate a temporary table by executing a stored proc and the filter results from the temporary table.
How can I do this.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-09 : 12:04:31
have you created the temp table. it needs to be created first. so do like below
CREATE TABLE #Temp
(
field1 datatype,
field2 datatype...
)
GO

insert into #Table Exec(@SQL);
Go to Top of Page
   

- Advertisement -