Storing XML data in a table

  • I am trying to convert data into XML Format. I tried converting data using the FOR XML clause. But there is no way I can Load the result set into a table or a local variable since sql server does not allow the use of insert statment with the XML clause. Is there anyway I can create XML data using SQL and load it into a column with NTEXT datatype or NVARCHAR datataype.

     

  • Here's my humble question. Why do you want to do that ???

  • I am trying to store data from many tables into one by converting each row into XML.

  • Ya I can figure that, but why would you want to denormalize your model, make it alsmot impossible to maintain, impossible to validate the data and maybe even slow it down??

  • Once I have loaded my table with all the XML data. I will convert it into a file, and will store it where ever the user wants to. Then when restoring will extract all the data from the XML and restore it into my tables

  • I don't wanna seem rude but I either don't understand what you really want to do or you need to learn how to do backups using sql server tools or other third party software. Xml is not the solution for this problem.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply