Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

BCP cannot handle space in column names with format files

There are several problem with BCP and space in column names.
1) You cannot generate an XML format at all if one column has space in the names.
2) If you generate an old-style format file with BCP for such table, BCP pukes when you try to use the format file, because the file now has too many fields.
3) If you attempt to quote the name in the format file, this yields a different error.

A simple work around is to remove the space in the column name. However, there may be occasions where you want to use BCP to export many tables and you generate BCP commands automatically, first one to produce the format file and one to export. That is, there is no room for manual intervention.

This issue appears from SQL 2000 and up, so this is not a new bug.

2 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Admin, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base