all groups > sql server programming > october 2004 >
You're in the

sql server programming

group:

BCP rowcount


BCP rowcount TLV
10/23/2004 8:32:09 PM
sql server programming: Hi,

I am working on data auto-archive process.
I move data from server1 to server2 using bcp command line .
I want to know the row count of each bcp queryout statement.

I executed this code in command line:

bcp "exec master..sp_who 1 " queryout "c:\sp_who.bcp" -S. -T -c

Is there is any way to get the rowcount of this statement to dos variable?

Thank you,
TLV





Re: BCP rowcount John Bell
10/23/2004 10:14:35 PM
Hi
You would probably be better writing this in code using the API (see
bcp_done in books online).

bcp "select * from pubs..authors" queryout pubs.out -T -c > pubs.txt
for /F "tokens=1 delims= " %i in ('findstr "rows copied" pubs.txt') do echo
%i

John

[quoted text, click to view]

AddThis Social Bookmark Button