bcp file format…. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

bcp file format….

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 "
" 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: empinput.txt -fc: empformat.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….

Your format file is not formatted correctly. The number of columns, the version and the delimiters are wrong. Use this: 8.0
2
1 SQLCHAR 0 4 "," 1 numbers
2 SQLCHAR 0 15 "
" 2 values And you data file should be like this: 1234,other
5678,column Nathan H.Omukwenyi

Have you checked SQL 2005 books online for formatfile option topic. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>