I/o Error While Reading Bcp Error-file
Contents |
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 i/o error while writing bcp data-file the FAQ by clicking the link above. You may have to register before you error = [microsoft][sql server native client 10.0]i/o error while reading bcp format file can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit
Unexpected Eof Encountered In Bcp Data-file
from the selection below. Results 1 to 2 of 2 Thread: [mssql] I/O error while reading BCP format 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 :-
(Русский)ישראל (עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsTroubleshootingCommunityForums Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Asked by: [Microsoft][SQL Native Client]I/O error while reading BCP format file SQL Server > Transact-SQL Question 0 Sign in to vote Hi Guys I am trying to bcp a data file into a table, but when i try http://forums.databasejournal.com/showthread.php?18211-mssql-I-O-error-while-reading-BCP-format-file to run the bcp command its giving me Error while reading BCP format file, Can some one hlp me with this please.... here is my format file 9.071 SQLCHAR 0 2 "" 0 ETXRA_FIELD ""2 SQLCHAR 0 6 "" 1 RECLAIM_REF_NO SQL_Latin1_General_CP1_CI_AS3 SQLCHAR 0 3 "" 2 COUNTRY_CODE ""4 SQLCHAR 0 6 "" 3 BENEFICIAL_OWNER_CODE ""5 SQLCHAR 0 12 "" 4 RECLAIM_FORM_REF_NO SQL_Latin1_General_CP1_CI_AS6 SQLCHAR 0 3 "" 5 CURRENCY_CODE SQL_Latin1_General_CP1_CI_AS7 SQLCHAR 0 1 "\r\n" 6 FORM_PURSUE_IND SQL_Latin1_General_CP1_CI_AS Data file 12RCRFNO123123456RECFORMREFNOCCDA here is the bcp command bcp database.dbo.table IN https://social.msdn.microsoft.com/Forums/sqlserver/en-US/690ab7d7-3f1e-41da-a1b1-d2900adecd3f/microsoftsql-native-clientio-error-while-reading-bcp-format-file?forum=transactsql C:\rama\data_file.txt -f C:\rama\format_file.fmt -S servername -U username -P password Thanks in advance. Wednesday, October 08, 2008 7:19 PM Reply | Quote All replies 0 Sign in to vote Here is alink that can help you with BCP in http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html Also can you try putting file in some other place except in C drive's root. I mean just make another folder in C drive and put the file in there many times due to security external process cannot directly read from C drive. Wednesday, October 08, 2008 8:23 PM Reply | Quote Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web s
IO error while reading BCP format file Discussion in 'SQL Server DTS-Related Questions' started by cutiepie, Sep 21, 2005. cutiepie New Member hi, i m having http://www.sql-server-performance.com/forum/threads/io-error-while-reading-bcp-format-file.19072/ problems with the bcp file format... 9.0 2 1 SQLCHAR 0 4 "," http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=107156 1 in_numbers SQL_Latin1_General_CP1_CI_AS 2 SQLCHAR 0 5 " " 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 IO 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 i/o error n again...i cant understand...wat m i suppose to do now...PLEASEEEEE TRY TO HELPPPP thnks in advance cutiepie, Sep 21, 2005 #2 satya Moderator Is this topic related to your current problem threadhttp://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=10436 ? Ensure the path and columns are properly specified for that bcp file. 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. satya, Sep i/o error while 21, 2005 #2 dineshasanka Moderator check this http://sqlteam.com/forums/topic.asp?TOPIC_ID=43246 ---------------------------------------- Cast your vote http://www.geocities.com/dineshasanka/sqlserver05.html http://spaces.msn.com/members/dineshasanka dineshasanka, Sep 21, 2005 #2 cutiepie New Member Hi,thanks for your suggestions.... i found the mistake...it was just after the last row i had to press ENTER twice or thrice so that there will be some more empty rows in the format file... thats all...n the problem is solved now.. thnks once again cutiepie, Sep 21, 2005 #2 (You must log in or sign up to reply here.) Share This Page Tweet Please click 'Forgot Your Password' to reset your password if this is your first time using the new forums. Your name or email address: Do you already have an account? Forgot your password? No, create an account now. Yes, my password is: Stay logged in SQL Server Performance Forums Home Forums > ARCHIVED SQL Server Posts > SQL Server 7.0 and 2000 Forum Topics > SQL Server DTS-Related Questions > Forums Forums Quick Links Search Forums What's New? Members Members Quick Links Registered Members Current Visitors Recent Activity Help Help Quick Links Smilies BB Codes Trophies Search titles only Posted by Member: Separate names with a comma. Newer Than: Ad
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 (bcp) bcp AR.dbo.InitTransactions IN C:\AR_project\LHT_data\WorkData\DEMO06Q4.