I have a problem using BCP. The request and the exported file doesn’t have the same number of lines.
This is the command I use :
'bcp "SELECT [email],[title],[firstname],[lastname],[dateofbirth],[zip],''RS'' as raison_soc FROM […]" queryout "C:\Export\20120611003-0.csv" -c -T -CRAW '
The request executed out of BCP returns 6 695 695 lines.
BCP execution output is:
So the right number of lines is supposed to be returned.
The output file contains 6 911 814 lines, 216 119 added lines. None of them is doubled.
SQL server 2008
Bcp version 10.0.5500.0
Just a guess, but perhaps some of the data contains row terminators (cr/lf). That would explain these symptoms.
Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?