SQL Server Performance Forum – Threads Archive
Bulk Insert failedHi, I’m trying to export/import data from one server to another using bcp utility with native type data-file. The export is ok and when I try to import the data into the other server, bcp fails with the following error: Unexpected EOF encountered in BCP data-file. Cannot insert the value NULL into column ‘columnname’, table ‘tablename’; column does not allow nulls. The strange thing is if I export and import the data-file on the same server it works but when I copy the file to the other server and try to import, it gives me this error. And if I don’t use the native type for the data-file everything works either. I’m using SqlServer 2000 and both servers have the same structures, collations, etc. Any ideas? Thanks in advance Leonardo Almeida
Check the referred COLUMNNAME properties about allowing nulls on the troubled server. http://www.craigsmullins.com/sql_ref.htm for information. Satya SKJ
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
Satya, Thanks for your reply, but although I have PK and FK on the server I export data, I don’t have them on the server I’m trying to import. Not Null is the only constraint I have on the destination server. Anything else I should investigate?
Did you check if there any NULL in original data?
SQL-Server-Performance.com All postings are provided â€œAS ISâ€ with no warranties for accuracy.
Luis Martin, There are no NULLs in original data, because the tables have the NOT NULL constraint. But I’ve found that the files exported from each server are different. I’ve duplicated my database on both servers, exported the same data from each one and compared the files exported and they are different. One of the files has special characters before and after columns data while the other file doesn’t. I have forced the same page code option but still no success. How can I enforce that the files written be the same, once I have the same collations, same page codes, same structures and same OS on both servers? Thanks in advance.