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.
Author |
Topic |
Clages1
Yak Posting Veteran
69 Posts |
Posted - 2009-09-10 : 16:26:22
|
HiIn this sample I get from BOLdoesnt solve my problembecause my XML is in a TXT file like INVOICE.XMLHow can i move my xml file to @doc or something like this" EXEC sp_xml_preparedocument @hdoc OUTPUT, 'c:\INVOICE.XML'tksClages DECLARE @hdoc intDECLARE @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 ? |
|
|
|
|
|