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):
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
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....
Thanks for your replies....but now...i have changed the version of format file as follow...n yeah i have 2columns only:
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
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
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