显示标签为“ahve”的博文。显示所有博文
显示标签为“ahve”的博文。显示所有博文

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

2012年3月25日星期日

BCP unility and SQL Server Management Studio Express

I ahve a utility which uses the bulk copy untility (or program) bcp.exe
which doesn't seem to be part of SQL Server Management Studio Express. I
don't need a database server on that machine but I do want the bcp.exe
program. How can I get this?
Many thanks for any help in advance!
Peter (peteATkapiti.co.nz) writes:
> I ahve a utility which uses the bulk copy untility (or program) bcp.exe
> which doesn't seem to be part of SQL Server Management Studio Express. I
> don't need a database server on that machine but I do want the bcp.exe
> program. How can I get this?
BCP comes with SQL Express. I don't remember off-hand if SQL Express
offers a client-only install, but you could try running the install and
see if you get that offer. Just make sure press all Advanced buttons
you see.
I guess you also could cull it from a an existing installation. You
would have to install SQL Native Client (which is available as a separate
install), but if you are lucky that maybe all. (Or have I seen a
BCP.rll somewhere?)
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
|||I had to install the SQL Express Toolkit to get bcp.exe.
But I now have a really strange situation I wonder if anyone can answer...
Just installed on Vista Ultimate.
At first I couldn't find BCP in what I thought should be an expected
directory (A bin directory in the SQL Express folder tree).
Instead, after doing a Vista "Search" on the entire SQL Server tree, it's
supposed to be in
...\Program Files\Microsoft SQL Server\90\Tools
But, when I browsed to that location, there are no files, just folders.
Re-launched Explorer to run "As Administrator" (which itself is an irritant)
in case files were hidden, but not so.
Started manually opening up folders and I found it in the same folder as
bcp.rll
...\Program Files\Microsoft SQL Server\90\Tools\Binn
Why the weirdness? This is the first time I've run a Microsoft OS Search for
over 15 years on anything which returned bad results like this.
Tony Su
www.su-networking.com
ISA
SBS
Enterprise Mobile Solutions Architect
"Erland Sommarskog" wrote:

> Peter (peteATkapiti.co.nz) writes:
> BCP comes with SQL Express. I don't remember off-hand if SQL Express
> offers a client-only install, but you could try running the install and
> see if you get that offer. Just make sure press all Advanced buttons
> you see.
> I guess you also could cull it from a an existing installation. You
> would have to install SQL Native Client (which is available as a separate
> install), but if you are lucky that maybe all. (Or have I seen a
> BCP.rll somewhere?)
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
|||Tony Su (TonySu@.discussions.microsoft.com) writes:
> I had to install the SQL Express Toolkit to get bcp.exe.
> But I now have a really strange situation I wonder if anyone can answer...
> Just installed on Vista Ultimate.
> At first I couldn't find BCP in what I thought should be an expected
> directory (A bin directory in the SQL Express folder tree).
> Instead, after doing a Vista "Search" on the entire SQL Server tree, it's
> supposed to be in
> ..\Program Files\Microsoft SQL Server\90\Tools
> But, when I browsed to that location, there are no files, just folders.
> Re-launched Explorer to run "As Administrator" (which itself is an
> irritant) in case files were hidden, but not so.
> Started manually opening up folders and I found it in the same folder as
> bcp.rll
> ..\Program Files\Microsoft SQL Server\90\Tools\Binn
> Why the weirdness? This is the first time I've run a Microsoft OS Search
> for over 15 years on anything which returned bad results like this.
It appears that your question is more about the search in Vista, and
I'm afraid I can't help with that. The search in Vista is very mysterious,
and nothing use unless I'm in desperation.
Tools\Binn is indeed the place..
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx