Hi all,
ISSUE:
=============== =====
In SQL 2005 (sp2) I get the following error when preforming a bulk
insert with an associated xml format file:
"Could not bulk insert. Unknown version of format file"
Question:
=============== =====
I am unsure what they mean by "unknown version". Specifically the
format file in question was created using bcp. Also the entire table
scenario was created from a msdn example.
Any ideas? have you seen this before?
NOTE: i can reproduce this issue outside the example but will refer to
msdn considering it is simple and easily reproducible.
Scenario
=============== =====
I can reproduce this error with the BULK INSERT example discussed on
msdn (example A)
http://msdn2.microsoft.com/en-us/library/ms191234.aspx
TO REPRODUCE:
* In short the table structure is:
Person (Age int, FirstName varchar(20), LastName varchar(30))
* Data File Template:
Age<tab>Firstna me<tab>Lastname <return>
* xml file format from bcp (and described on msdn)
<?xml version="1.0"?>
<BCPFORMAT
xmlns="http://schemas.microso ft.com/sqlserver/2004/bulkload/format"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharT erm" TERMINATOR="\t"
MAX_LENGTH="12"/>
<FIELD ID="2" xsi:type="CharT erm" TERMINATOR="\t"
MAX_LENGTH="20" COLLATION="SQL_ Latin1_General_ CP1_CI_AS"/>
<FIELD ID="3" xsi:type="CharT erm" TERMINATOR="\r\ n"
MAX_LENGTH="30"
COLLATION="SQL_ Latin1_General_ CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="age" xsi:type="SQLIN T"/>
<COLUMN SOURCE="2" NAME="firstname " xsi:type="SQLVA RYCHAR"/>
<COLUMN SOURCE="3" NAME="lastname" xsi:type="SQLVA RYCHAR"/>
</ROW>
</BCPFORMAT>
* Here is some the actual sql statement that pulls this all together
BULK INSERT mytestnames
FROM 'C:\datatest\ex ampledata-c.Dat'
WITH (FORMATFILE = 'C:\datatest\ex amplefmt.Fmt');
Thanks in advanced for any feedback.
Cheers!