Results 1 to 2 of 2

Thread: about bcp

  1. #1
    Join Date
    Nov 2003
    Posts
    42

    Unanswered: about bcp

    a txt file:
    aaaaa 11 aa
    bbbbb 22 df
    ccccc 33 we
    a table structure:name char(5),age char(5) ,address char(5)
    "bcp in" from the txt file to the table,select will likes the following:
    name age address
    ------- ------ -------
    ccccc 33 we
    aaaaa 11 aa
    bbbbb 22 df
    ccccc 33 we
    it seems well done,
    but when "bcp out" to another txt file using bcp.fmt like
    10.0
    3
    1 SYBCHAR 0 5 " " 1 name
    2 SYBCHAR 0 5 " " 2 age
    3 SYBCHAR 0 5 "\n" 3 place

    and then "bcp in" to the table using the same bcp.fmt
    and select will show me the following:
    name age address
    ------- ------ -------
    ccccc 33
    aaaaa 11
    bbbbb 22
    ccccc 33

    the "address" colum is empty,can any body explain it in detail??

  2. #2
    Join Date
    Jan 2003
    Posts
    26

    Re: about bcp

    I think it has to do with the fact that the third field in your bcp.fmt file is "place" instead of "address". There's no "place" field in your table. I'm surprised this didn't generate an error though.

    Originally posted by shawnlee
    a txt file:
    aaaaa 11 aa
    bbbbb 22 df
    ccccc 33 we
    a table structure:name char(5),age char(5) ,address char(5)
    "bcp in" from the txt file to the table,select will likes the following:
    name age address
    ------- ------ -------
    ccccc 33 we
    aaaaa 11 aa
    bbbbb 22 df
    ccccc 33 we
    it seems well done,
    but when "bcp out" to another txt file using bcp.fmt like
    10.0
    3
    1 SYBCHAR 0 5 " " 1 name
    2 SYBCHAR 0 5 " " 2 age
    3 SYBCHAR 0 5 "\n" 3 place

    and then "bcp in" to the table using the same bcp.fmt
    and select will show me the following:
    name age address
    ------- ------ -------
    ccccc 33
    aaaaa 11
    bbbbb 22
    ccccc 33

    the "address" colum is empty,can any body explain it in detail??

Posting Permissions

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