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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP with Stored Procedures

Status
Not open for further replies.

r3g

Programmer
Apr 29, 2003
5
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top