I/o Error While Reading Bcp Format-file Sybase
New? Advanced Search Forum Database Discussions MS SQL Server 7/MS SQL Server 2000 [mssql] I/O error while reading BCP format file If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register i/o error while writing bcp data-file before you can post: click the register link above to proceed. To start viewing messages, select error = [microsoft][sql server native client 10.0]i/o error while reading bcp format file the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: [mssql] I/O error while reading BCP format unexpected eof encountered in bcp data-file file Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 02-29-2000,01:37 AM #1 Daniel Bolger Guest [mssql] I/O error while reading BCP format file Hi All, I had a problem today where BCP would not read the format file I created giving the following error: I/O error while reading BCP format file. I searched the archives here at swynk.com and found a thread titled exactly the same as the one I am now creating. There were numerous responses to this thread but none of them seemed to solve the problem for me (short of the one that suggested using BCP to create the format file, which I didn't want to do). I used BCP to create a format file for me (which looked identical to the format file that I created) and it worked fine. With my suspicions aroused, I used a binary file viewer to look at the contents of each file and highlight the differences. Apart from the usual variations in whitespace I noticed that the my file did not have any carriage returnline feed at the end of the last row definition. My format file ended at the end of the last row definition line. It did not have any carriage returns and line feeds. I matched the one generated by BCP and added the following " " to the end of the file, tested my format file and it worked perfectly. The moral of the story is, make sure when you create a format file, you have an empty line at the end of the file (ie: after your last "Server Column Name", make sure you have " " sans quotes). Hope this saves someone a few hours :-) Cheers, Dan. Reply With Quote 11-26-2007,01:42 PM #2 hi_madan View Profile View Forum Posts Registered User Join Date Nov 2007 Posts 1 dude... you are a lifesaver. long live Dan! madan Reply With Quote Quick Navigation MS SQL Server 7/MS SQL Server 2000 Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Database Discussions IBM DB2 Informix Microsoft Access Microsoft SQL Server 2008 Microsoft SQL Server 2005 MDX
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: bcp file format...its killing me...pleaseeeeeeeee help... Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-20-05,08:50 #1 cutiepie View Profile View Forum Posts Registered User Join Date Sep 2005 Posts 20 Unanswered: bcp file format...its killing me...pleaseeeeeeeee help... Hi, i http://forums.databasejournal.com/showthread.php?18211-mssql-I-O-error-while-reading-BCP-format-file 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 http://www.dbforums.com/showthread.php?1191116-bcp-file-format-its-killing-me-pleaseeeeeeeee-help 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.... Reply With Quote 09-20-05,09:09 #2 Brett Kaiser View Profile View Forum Posts Visit Homepage Window Washer 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. Reply With Quote 09-20-05,10:30 #3 Pat Phelan View Profile View Forum Posts Visit Homepage Resident Curmudgeon 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 Reply With Quote 09-21-05,03:58 #4 cutiepie View Profile View Forum Posts Registered User Join Date
Cause System I/O routine failed. Action/solution Contact Sybase Technical Support. Additional information Versions All Copyright © 2012. Sybase Inc. All rights reserved. View this document as PDF
SQL Server experts to answer whatever question you can come up with. Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums. SQL Server Forums Profile | ActiveTopics | Members | Search | ForumFAQ Register Now and get your question answered! Username: Password: Save Password Forgot your Password? All Forums General SQL Server Forums New to SQL Server Programming Format file problem again Reply to Topic Printer Friendly Author Topic tash Starting Member 12 Posts Posted-07/22/2008: 14:03:49 Hello, I try to import data from text file into table, created with this query: USE AR; CREATE TABLE dbo.InitTransactions ( [TransactionID] BIGINT NOT NULL , [TransactionDate] BIGINT ) GO I don't have primary key here, I don't need it.I need to import only 1st and 6th columns of text file into 1st and 2nd table columns respectively.This is example of data in text file (this is ONE row, which consists of 23 fields, delimited with $, last field is also terminated with $): 5045669$6071557$F$$5045669-6$20060213$20060616$20060707$EXP$BR-ABBOTT-06P-020-0336330-00$ABBOTT$$$M$Y$$$20060707$$20060611$$$IRELAND$ so the first field "TransactionID" here is 5045669and the sixth field "TransactionDate" is 20060213 (we use format YYYYMMDD)I use the following format file: 8.0 23 1 SQLBIGINT 0 8 "$" 1 TransactionID "" 2 SQLBIGINT 0 8 "$" 0 Extra "" 3 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 4 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 5 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 6 SQLBIGINT 0 8 "$" 2 TransactionDate "" 7 SQLBIGINT 0 8 "$" 0 Extra "" 8 SQLBIGINT 0 8 "$" 0 Extra "" 9 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 10 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 11 SQLCHAR 0 100 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 12 SQLBIGINT 0 8 "$" 0 Extra "" 13 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 14 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 15 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 16 SQLBIGINT 0 8 "$" 0 Extra "" 17 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 18 SQLBIGINT 0 8 "$" 0 Extra "" 19 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 20 SQLBIGINT 0 8 "$" 0 Extra "" 21 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 22 SQLCHAR 0 50 "$" 0 Extra SQL_Latin1_General_CP1_CI_AS 23 SQLCHAR 0 50 "$\r\n" 0 Extra SQL_Latin1_General_CP1_CI_AS I use the following command