Home Dashboard Directory Help
Search

SQL Server 2012 BCP API - bcp_init fails for local temporary tables by btrigg


Status: 

Closed
 as By Design Help for as By Design


5
0
Sign in
to vote
Type: Bug
ID: 780567
Opened: 3/4/2013 5:03:49 AM
Access Restriction: Public
0
Workaround(s)
view
3
User(s) can reproduce this bug

Description

Hi, we are migrating to SQL Server 2012 using the SQL Server Native Client 11.0. We have found we can no longer use the BCP api with a local temporary table as the call to bcp_init it fails with:

"SQL Diag:42000:1:11525:[Microsoft][SQL Server Native Client 11.0][SQL Server] The metadata could not be determined because statement 'select * from #Test' uses a temp table.\n"

We are using BCP to insert data into ~40 tables asynchronously. We use the local temporary table to remove duplicates from the source data, then merge into the database tables to ignore any duplicates in the destination table. Using real tables would be difficult to manage in this scenerio.
Details
Sign in to post a comment.
Posted by Jason Markantes on 4/10/2014 at 2:10 PM
This has been a problem for us also using oracle's PeopleSoft's SQR reports program. Everything worked for years in SQL Server 2005, we upgraded to 2012, and now we're running into this error. A rewrite of these reports would be significant, so we're looking for the root cause and an easier work around before committing developer resources. oracle support is pretty well stuck on pointing out it's a SQL Server bug (referring to this webpage), so now we're stuck in that fun infinite loop of vendor's pointing at each other. :)

In our particular case we're creating a new temp table, and then within oracle's SQL framework looping through the table and running further queries on that data. One report uses 17 tables, creating 11 temp tables to hold working data while creating the report. A rewrite to use permanent working tables appears to us to be quiet messy.
Thank you,
Jason
Posted by BOFHRAF on 1/7/2014 at 2:12 AM
I know, that it is the current behaviour, but it worked in previous versions of Native Client. So it is a bug. I cannot understand, why this issue is simply closed as By Design. We need a solution for this problem or we cannot use Native Client 11.
Posted by Microsoft on 7/26/2013 at 12:48 PM
Unfortunately this is the current server behavior. There is no plan to change it in the near term.
Posted by mattweir on 5/8/2013 at 7:57 PM
We are having this same problem too
Posted by Microsoft on 4/16/2013 at 1:19 PM
Thanks for youe feedback. Our Dev is taking a look.
Posted by Microsoft on 4/16/2013 at 1:19 PM
Thanks for youe feedback. Our Dev is taking a look.
Sign in to post a workaround.