2012年3月29日星期四

bcp_exec() Failed

Has anyone had the above error ?

We ahve an app that uses a C++ to bulk insert into a database, and
during the procedure it some times gives us a error "bcp_exec()
Failed"

Any ideas.

Cheers.john (johnboy1973@.hotmail.com) writes:
> Has anyone had the above error ?

Many times!

> We ahve an app that uses a C++ to bulk insert into a database, and
> during the procedure it some times gives us a error "bcp_exec()
> Failed"

But I cannot recall that the error comes alone, but is always preceded
by other error messages which tells you what the problems with the
bulk copy is. The message "bcp_exec() failed" can be about anything.

If you have more error messagee, please share them too. If you don't,
maybe you should review the error handling in your C++ program, so that
it is not swallowing all error messagee but the last one.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Cheers. The c++ app is not handling the error at all well, but
compains occasionally in the event logs of invalid xml.

Cheers|||john (johnboy1973@.hotmail.com) writes:
> Cheers. The c++ app is not handling the error at all well, but
> compains occasionally in the event logs of invalid xml.

Looks like you need to improve the error handling then.

Which client library are you using? Coming from the DB-Library corner,
I assumed that you were using that. But there might be a bcp_exec() in
other libraries too. And DB-Library does not understand XML. Then again
I can't see where XML comes into the picture with any bulk-load operation.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Its a pain, basically, the app is VB6 connects to com services which
are written in C++, accessed via iis6 .asp page. So it gets the data
it requires from a sql database via a com+ / C++ Dll. Then trys to
pass the result set through bcp.

So im assuming its not the bcp that is at fault but the app pasing the
data too it. So off we go again in a circle.

Thanks for youre input though.

John|||john (johnboy1973@.hotmail.com) writes:
> Its a pain, basically, the app is VB6 connects to com services which
> are written in C++, accessed via iis6 .asp page. So it gets the data
> it requires from a sql database via a com+ / C++ Dll. Then trys to
> pass the result set through bcp.
> So im assuming its not the bcp that is at fault but the app pasing the
> data too it. So off we go again in a circle.

Maybe. But permit me to make the comment that a major reason that I am
not able to give better advice is that I know precious little of your
application. From wnat you describe above, it seems quite complex, and
maybe it's too complex to cover in a newsgroup posting.

But the general rule is: the more precise information you provide, the
more likely it will be that you get a useful answer.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

没有评论:

发表评论