Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    91

    Unanswered: BCP Export - Exlude Tailing Blank Space Terminator

    I am using a cursor and BCP in SQL Server 2000 to export rows of data into seperate text files. This is working fine for me except for 1 problem. The content of each file generated has a trailing space. At the end of my BCP statement I use -T -c -r\0. Instead of not adding any terminator at all though, 1 blank space is being added. Can someone please help me with my bcp export statement so that there are no trailing spaces or extra lines added to the end of my generated text files. By the way there are definitely no trailing spaces in the source data that I am using to export so the problem is not with the source data.

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    I can't help but wonder why you have the -r\0 ?

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    It's not a space, it's a NULL character, just like you requested
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •