Converting Database into XML File

  • Guys,

    I have been asked to convert a set of databases into XML files and the stored procedures into X-path statements.

    I have a few questions that I am hoping the group can help me with:

    1. Has anyone done anything like it before?  If so, could you share some of the experiences you've had, templates (mapping database to xml structure) and/or software tools used for conversion ...

    2. Can anyone tell me known advantages and disadvantages for converting a database into an xml file and then querying it using X-path or some other library?

    Thanks a lot

  • I never did like this...

    But you can use FOR XML cluase to save the data in xml format...

    MohammedU
    Microsoft SQL Server MVP

  • Great.

    Could you tell me why you do not like it?  Are there known disadvantages of quering xml data?

     

     

    Thanks a lot.

  • I mean to say " I never did this" where as I typed "like" extra word which changed meaning entirely...

    I never did this so I don't have any opinion on this...

     

    MohammedU
    Microsoft SQL Server MVP

  • Ah ... data general itself is actually pretty trivial http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0901/en/html/dbugen9/00000532.htm

    ... although I am told that working with xml vs db itself is less efficient

    Thanks for the hint

  • What do they want to do with those files?

     

    Why not use full db backups and let the other guys do the import work (presuming a lot of things here ).

  • We want XML files as a replacement for the current dbs.

    I've been told that for what we do here, this should be more efficient.

    It is just a few tables and we'll have a few simple queries, that just perform selects/search.

  • I can not give you the technical support but XML format makes the data compatible in hetrogeneous environemt. This makes the secured flow of data over the web, much faster and in structured manner. Can you be specfic on what exactly is the purpose of converting your DB into XML files?

    Pankaj Khanna
    Database Administrator - SQL Server 2000

    Keep hope to keep you intact...

  • If you are familiar or if you're using .NET, you can retrieve your data tables and use a dataset to hold the data. The dataset have a SaveXML method which will save all the info to an XML file. Subsequestly, you can use the dataset's ReadXML method to read from the XML file.

    The advantage of using XML files as your source is to keep the data mobile, provide asynchronous updates, transport the data over the wire easily (thru firewalls and all), and to be able to distribute the data to remote locations easily.


    Ronald San Juan | SQL DBA
    ID 710124 ~ Code "Northwind"

  • Guys,

    Thanks for great replies!

    Pankaj: I am not totally clear about the purpose of the conversion, as I was just told to do it.  I believe that the goal is to become database independent, as all we really need to do are simple searches and the data will not be modified much.  We just want the appication to deal with an XML file and not the database.  I was also told that it would be more efficient, using X-path statements, although my initial experiments show that it is not necessarily more efficient.  Namely, I ran the same (extremely simple) query in the database versus c# (.net) implementation of xpath.  The later runs same or even a bit slower.

    Ronald: The pros you mentioned are very helpful.

Viewing 10 posts - 1 through 9 (of 9 total)

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