Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sp_xml_preparedocument From a Txt file

Author  Topic 

Clages1
Yak Posting Veteran

69 Posts

Posted - 2009-09-10 : 16:26:22
Hi
In this sample I get from BOL
doesnt solve my problem
because my XML is in a TXT file like INVOICE.XML
How can i move my xml file to @doc
or something like this
" EXEC sp_xml_preparedocument @hdoc OUTPUT, 'c:\INVOICE.XML'

tks
Clages





DECLARE @hdoc int
DECLARE @doc varchar(1000)
SET @doc ='
<ROOT>
<Customer CustomerID="VINET" ContactName="Paul Henriot">
<Order CustomerID="VINET" EmployeeID="5" OrderDate="1996-07-04T00:00:00">
<OrderDetail OrderID="10248" ProductID="11" Quantity="12"/>
<OrderDetail OrderID="10248" ProductID="42" Quantity="10"/>
</Order>
</Customer>
<Customer CustomerID="LILAS" ContactName="Carlos Gonzlez">
<Order CustomerID="LILAS" EmployeeID="3" OrderDate="1996-08-16T00:00:00">
<OrderDetail OrderID="10283" ProductID="72" Quantity="3"/>
</Order>
</Customer>
</ROOT>'
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @hdoc OUTPUT, @doc
-- Remove the internal representation.
exec sp_xml_removedocument @hdoc

hadi teo
Starting Member

4 Posts

Posted - 2009-09-16 : 18:48:06
After googling around at MSDN : http://msdn.microsoft.com/en-us/library/ms187367.aspx, the command sp_xml_prepareddocument is available only for SQL 2005 and SQL 2008. Which version of SQL are you using now ?
Go to Top of Page
   

- Advertisement -