Hi,
I have a stored procedure which creates a temp table and inserts data into it from other tables. After inserting all the data into that temp table, the SP just does a select * from #tmptable query at the end to return all the contents of the temp table.
Now when I use BCP with that stored procedure I get an "invalid object name #tmptable". the SP works fine through query analyser.
anyone know how to get around it? I have created a secondary table which is a temp table but not in tempdb and the SP and BCP work fine with that. It just seems to bomb out when using real temp tables created at run-time.
Thanks
I have a stored procedure which creates a temp table and inserts data into it from other tables. After inserting all the data into that temp table, the SP just does a select * from #tmptable query at the end to return all the contents of the temp table.
Now when I use BCP with that stored procedure I get an "invalid object name #tmptable". the SP works fine through query analyser.
anyone know how to get around it? I have created a secondary table which is a temp table but not in tempdb and the SP and BCP work fine with that. It just seems to bomb out when using real temp tables created at run-time.
Thanks