decrypt Posted July 14, 2006 Posted July 14, 2006 (edited) I'm getting an error while trying to load some data that includes a binary field into a database. Doing a INSERT INTO works fine, but doing a BULK LOAD doesn't. How could I fix this problem? Do I have to specify any additional information in the BULK INSERT command? Command: BULK INSERT Table_2 FROM 'c:\temp.txt' WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = ':') File Contents: (temp.txt) DEFAULT,0x1000 The binary field is the final field (col 2) Error Message: Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (data). The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error. Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)". Thanks for the help. Edit: btw, i'm using SQL Server 2005 Express Edited July 14, 2006 by decrypt Quote
decrypt Posted July 17, 2006 Author Posted July 17, 2006 Well after trying to figure it out again for a couple of hours I finally figured it out. With BULK INSERT you completely leave off the 0x. Hopefully this helps somebody else out in the future who did not realize this either. Also make sure it's an even number of characters. I tried it multiple amounts of times without the 0x, but I guess I had an uneven amount of characters. *PROBLEM SOLVED* Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.