Wednesday, March 7, 2012

FOR XML EXPLICIT - Insert XML Data into a different Table

Greetings,
How do I insert the XML document returned from the usage of FOR XML Explicit
into a different table within a Stored Procedure.
I have been able to use the FOR XML Explicit to generate the XML document
but I need to insert it into a different table as a Text value.
TIA,
KOYIf you are using SQL Server 2005, you can just insert it. In SQL Server
2000, FOR XML results have to be returned to the client-side. So you would
have to write an OLEDB/ADO program that returns the data and then reinserts
it. If you need to drive it from the server, you can use the sp_OA stored
procs.
But the best thing would be to get the April CTP of SQL Server 2005 if
running Beta software is an option...
Best regards
Michael
"Kayode Yusuf" <KayodeYusuf@.discussions.microsoft.com> wrote in message
news:8693AAA4-B0BE-4926-A179-2039BC811F1C@.microsoft.com...
> Greetings,
> How do I insert the XML document returned from the usage of FOR XML
> Explicit
> into a different table within a Stored Procedure.
> I have been able to use the FOR XML Explicit to generate the XML document
> but I need to insert it into a different table as a Text value.
> TIA,
> KOY

No comments:

Post a Comment