I am doing a bulk insert of some data that contains a column of xml data. I get an error when trying to do the bulk insert and added the ERRORFILE option. What happens is the error file shows up while the command is running, but as soon as I get the actual error in the messages window of SQL Server Management Studio the error file disappears. The documentation indicates that the error file should contain the records that produce the error, but since the file disappears I'm not able to see the record(s) that produce the error. Please advise, any help is very much appreciated .. thanks, john
I get the following in the messages window:
Msg 9411, Level 16, State 1, Line 1
XML parsing: line 1, character 725, semicolon expected
My bulk insert command:
bulk
insert Assessor.dbo.Taxesfrom
'\\scux00\ExportSQL\exporttaxes.txt'with
(FORMATFILE = 'C:\Taxstatement2columns.xml',MAXERRORS
= 50,ERRORFILE = 'C:\Errors.txt')the format file:
< xml version="1.0" >
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="|" MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\n" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="ParcelID" xsi:type="SQLCHAR"/>
<COLUMN SOURCE="2" NAME="xmlStream" xsi:type="SQLVARYCHAR"/>
</ROW>
</BCPFORMAT>