Error bulk insert on Date DataType using Format File - XML
Posted on 2009-04-12
I have a fixed width data file with 500k records that I am importing using Bulk Insert. I have created an xml format file and I am running into an issue when trying to import date fields.
The data.txt file has a date column that stores it's values like this: 19741022 (yyyymmdd)
I'm using SQL2008 and the target column in the database table is of datatype: date
My formatfile.xml for this column is:
<COLUMN SOURCE="18" NAME="DOB" xsi:type="SQLDATETIME" />
When I run the insert I receive the following error:
type mismatch or invalid character for the specified codepage
Any help is appreciated!