July 30, 2007 at 2:54 pm
Hi,
I need to be able to output the number of rows exported through bcp to another file. Is there a simple way to do this?
The current code is as follows:
DECLARE
@sql varchar(8000)
SELECT
@sql = 'bcp "exec stored procedure" queryout Drive:\path\output.csv -T -c -t,'
EXEC
master..xp_cmdshell @sql
Help is greatly appreciated
KR
July 31, 2007 at 1:33 am
There's no real nice way I know of because it is a process outside of SQL.
You could do a count on the table but this could be slow.
You could also insert the results from the XP_CMDShell into a table and grab the rows from there. Will have to do some string manipulation to do this though.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
July 31, 2007 at 8:47 am
That is what I was afraid of.
Thanks
KR
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy