Friday, February 24, 2012

Capture Records That Failed Insertion From XML

Does anyone know an effective way to capture any records that failed to
insert into a table when inserting from an xml document in SQL Svr
2000?

thanks.

-akAyron (akitchen@.lrs.com) writes:
> Does anyone know an effective way to capture any records that failed to
> insert into a table when inserting from an xml document in SQL Svr
> 2000?

It would certainly help if you told us how you insert your records.
Openxml or XML bulk load?

Particularly in the matter case, I would recommend trying
microsoft.public.sqlserver.xml.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for the reply, Erland. I'm new to the XML bulk insert. I'll look
into that method. I've also transitioned the topic to the group that
you mentioned.

-ak|||"Ayron" <akitchen@.lrs.com> wrote in message
news:1108507580.773174.268630@.l41g2000cwc.googlegr oups.com...
> Does anyone know an effective way to capture any records that failed to
> insert into a table when inserting from an xml document in SQL Svr
> 2000?

I have used sqxmlbulkload.
Not really investigated it in depth but the default behaviour is to crash
and burn if a record contains invalid data.
I wrote an access app which a support user investigates problems with.
They import the xml file to a table and a screen iterates through all fields
comparing values with the datatypes.
It marks records as bad.
The screen shows only bad records and uses conditional highlighting to
highlight the bad field in a record.

--
Regards,
Andy O'Neill

No comments:

Post a Comment