Hi all,

We are using a VB component to create and save an XML document on our local LAN.

We want to load this straight into a DB Table using a query based on OPENXML. Trouble is, the sp_xml_preparedocument command always throws an error.

Here is some code:

>>>> CODE >>>>
DECLARE @idoc int
DECLARE @doc varchar(1000)

EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
<<<< END OF CODE <<<<

where @doc is the filename of our file on the LAN to be opened, and @idoc is the handle to be created.

the error is:
XML parsing error: Invalid at the top level of the document.

Here is some of the XML Document saved on the LAN that whouls be opened by sp_xml_preparedocument and prepared.

<?xml version="1.0" encoding="UTF-8" ?>
<xdata created_by="OSA" created_at="Thu Nov 13 11:33:33 EST 2003">
<rows row_count="1000">

Any advice or tips whould be very helpful...