Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Bcp load problem

Author  Topic 

Stabia
Starting Member

2 Posts

Posted - 2004-03-31 : 09:47:43
I am trying to load a table that has a field called EmpHireDate, data type of "datetime" and a lenght of 8. I am using the bcp.fmt with an entry of "SQLDATETIME 1 8 "" 4 EmpHireDate". I create the input data file with the value of "05/15/1995" in the date field. I tried with a fixed format input file, a delimited file with "~" as the field terminator, native datatypes, etc. I receive an error message "Unexpected EOF encountered in BCP-data file". I even created a "temp" table with just this one field and still received this message. I have no problems with datatypes of "SQLCHAR". I even let the BCP utility create the bcp.fmt file for me but no go. How do you set this up?

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2004-03-31 : 10:16:44
I think an enter at the end of the data file, should do the trick.

- Sekar
Go to Top of Page

Stabia
Starting Member

2 Posts

Posted - 2004-03-31 : 16:11:25
I tried that and it does not work.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-31 : 16:17:36
Do you even need a format file for this?

bcp SomeDB.dbo.SomeTable in C:\temp\SomeTable.txt -Sserver1 -Usomeuser -Ppwd -c -r\r\n

Tara
Go to Top of Page

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2004-04-01 : 03:54:14
Can you post the format file ??

- Sekar
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-04-01 : 08:27:44
If the data in the file is actual text, use SQLCHAR as the data type. SQLDATETIME would be used if you were importing a native format SQL Server data file.
Go to Top of Page
   

- Advertisement -