Help Using Sp_xml_preparedocument

Jul 20, 2005

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:
[color=blue][color=green][color=darkred]
>>>> CODE >>>>[/color][/color][/color]
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 should 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">
<row>
<COL1>714761905</COL1>
<COL2>714761905</COL2>
<COL3>714761905</COL3>
</row>
</xdata>

Any advice or tips whould be very helpful...

thanks

Phil



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

View 1 Replies


ADVERTISEMENT

Sp_xml_preparedocument

Jun 21, 2007

We are thinking about using this sproc because one of our .NET app's is basically handling an array of data. The .NET guys want to give me 1 input parameter (i.e. XML) and then I would use the sproc to parse it and store the base data in columns.

Anyone witth experience with this or any comments would be appreciated

View 1 Replies View Related

Sp_xml_preparedocument

Sep 12, 2005

I have been trying to handle XML DataSets and read them into tables inthe SQL Server 2000. Every place I read about sp_xml_preparedocument itseems to me as if it is an in-built stored procedure the comes with theSQL Server installation. Am I right, or is it something that needs to bewritten for specific purposes/??Please comment.Thank you.*** Sent via Developersdex http://www.developersdex.com ***

View 1 Replies View Related

Sp_xml_preparedocument

Mar 7, 2007

Hi,

Can i use sp_xml_preparedocument function of openxml in SQLce ?

or what is the optimized way to insert (bulk) in SQLce ?

I am using SQL SERVER 2005 COMAPCT EDITION.

Thanks,

Jayant

View 1 Replies View Related

Sp_xml_preparedocument CDATA Reserved Characters

Nov 29, 2007



I have tried both in sql server 2000 and sql server 2005 the following code:

DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><![CDATA[línea átona]]></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))

I always get an error 6603 in SQL2000 and 6602+8179 in SQL2005, wich means it can't parse the 'í' and 'á' characters, though they are in a CDATA.
I have tried with <,>,@ characters and it works fine.

I have also tried using '&aacute;' and '&iacute;' without CDATA but I get the same message:

DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><l&iacute;nea &aacute;tona></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved