BCP inconsistency (request differs from output)

Unanswered BCP inconsistency (request differs from output)

  • Tuesday, June 19, 2012 7:22 AM
     
     

    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 :

    Exec master..xp_cmdshell '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.

    Versions:

    SQL server 2008

    Bcp version 10.0.5500.0

All Replies

  • Tuesday, June 26, 2012 1:43 AM
     
     
    Any progress?  It looks something odd.
  • Tuesday, June 26, 2012 1:53 AM
     
     

    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/