Thank you in advance
I am trying to retrieve the number of row that BCP process upon
completion,also how to find out what errors have occured when using the BCP
command.
thank you
tomasHi Tomas,
BCP is designed in a way that you cannot have all the functions in it. but
then they work pretty fast.
Since its not mentioned in your post, I am gonna assume that you are doing a
bcp OUT to a text file.
you can specify the maximum number of acceptable error in your bcp command.
In addition to that if you are coding all this in QA using xp_cmdshell you
can also create say something like balancing file to report the count(*) of
how many records you bcp.
It would be be interesting to know (from others) if you can actually count
the number of rows returned in bcp. As far as i know, there is no direct way
of doing it.
Hope this helps
ABhishek
"Tomas" wrote:
> Thank you in advance
> I am trying to retrieve the number of row that BCP process upon
> completion,also how to find out what errors have occured when using the BC
P
> command.
> thank you
> tomas|||Hi tomas,
In addition to what i wrote earlier today, I would suggest you to use the
following
declare @.someCommand
set @.someCommand = 'bcp "Select blah blah" queryout "c:/whatever place"
-U<userID> -P<pass> -c
exec master..xp_cmdshell @.somecommand
When u run it thru QA you will get some output as
"Starting copy....
XXXX rows sucessfully bulk-copies to host file, Total received: XXXX
XXXX rows copied
Network Packet size (byted) : xxxxx
clock time(ms.) total xxxx
"
Then going forward you can also specify the maximum acceptable errors in
your bcp command line.
Does it helps ' Do let me know if there was something else that you wanted
to acheive.
Abhishek
"Tomas" wrote:
> Thank you in advance
> I am trying to retrieve the number of row that BCP process upon
> completion,also how to find out what errors have occured when using the BC
P
> command.
> thank you
> tomas
No comments:
Post a Comment