Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    20

    Angry Unanswered: bcp file format...its killing me...pleaseeeeeeeee help...

    Hi,
    i wanted to ask on the same context of bcp...i m trying to insert two rows into a table using the bcp command prompt and the bcp file looks as follow(format.fmt):
    7.0
    3
    1 SQLCHAR 0 4 "\"," 1 numbers
    2 SQLCHAR 0 15 "\"" 2 values
    3 SQLCHAR 0 2 "\r\n" 3 finish

    and the input file has the following contents
    1234,"other"
    5678,"column"

    now when i m running the command as
    bcp master.dbo.two_column in c:\temp\input.txt -fc:\temp\format.fmt -Sserver -Uuser -Ppasword -T

    it gives me the error as sqlstate 07009 with native state =0 and the error as = [Microsoft][SQL Native Client] Invalid descriptor index

    i m using sql server 2005 (YUKON)...can anyone pleaseeeeeeeeeeeeee tell me how can i solve this problem?????????????????so that i can insert these rows into my table two_column....
    thanks ...pleaseeeeeeeeee help me....

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    First off, line one should not be 7.0 for 2005.

    For SQL 2k it.s8.0

    I guess 2005, it should be 9.0, but I don't know that for sure.

    Did you get the 2005 BOL Beta as well?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Just curious, but what's the DDL for creating your table? I suspect it only has two columns.

    -PatP

  4. #4
    Join Date
    Sep 2005
    Posts
    20
    Thanks for your replies....but now...i have changed the version of format file as follow...n yeah i have 2columns only:
    9.0
    2
    1 SQLCHAR 0 4 "," 1 in_numbers SQL_Latin1_General_CP1_CI_AS
    2 SQLCHAR 0 5 "\r\n" 2 values SQL_Latin1_General_CP1_CI_AS

    and the input file is
    1234,other
    5678,column

    but now its givin me the error as I\O error while reading BCP format file....

    it was workin for sometime..it copied these two rows as well...but again its givin me this error again n again...i cant understand...wat m i suppose to do now...PLEASEEEEE TRY TO HELPPPP
    thnks in advance

  5. #5
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Can you post the exact error ?
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  6. #6
    Join Date
    Sep 2005
    Posts
    20
    hi,
    the error was just that I\O error while reading the BCP file format...but now finally its over since i had to press enter twice...after the last row in the format file...just some empty rows in the format files had solved my problem
    thnks.

Posting Permissions

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