locked
Storing data in XML files or SQL Server 2005? RRS feed

  • Question

  • Hi,
    Using ASP.Net 2.0, SQL Server 2005 we are developing a portal.
    Portal features include forum and articles and many others.

    With respect to forums and articles, which is the best practice, whether store the data in the SQL Server 2005 or in XML files?

    Thanks!
    Som
    Sunday, July 6, 2008 4:48 AM

Answers

  • Hi Som,

    Welcome to MSDN SQL server XML Forum.

    First of all, I would suggest you should use SQL server 2005 Database to store your data, rather than XML files. I am not sure whether that is what you wanted to ask. You mentioned XML files and I think that sounds little odd in this context. So if you really meant XML files (disk files), then I would say NO to it.

     

    Or if you meant the XML data type of SQL server, then the answer is 'it depends'. In most of the database projects, there are some part of the data that is suitable for XML columns and a major part of the data may be ideal for relational tables. So depending upon the nature of the data, you should decide which part should go to relational tables and whch to XML columns (if any)

     

    Do not go for XML just because XML is supported. Go with XML when you feel that a certain piece of information is better stored in an XML column. Unstructured or semistructured data is ideal for XML columns and other pieces of information should go to relational tables.

     

    regards

    jacob

    Sunday, July 6, 2008 8:28 AM

All replies

  • Hi Som,

    Welcome to MSDN SQL server XML Forum.

    First of all, I would suggest you should use SQL server 2005 Database to store your data, rather than XML files. I am not sure whether that is what you wanted to ask. You mentioned XML files and I think that sounds little odd in this context. So if you really meant XML files (disk files), then I would say NO to it.

     

    Or if you meant the XML data type of SQL server, then the answer is 'it depends'. In most of the database projects, there are some part of the data that is suitable for XML columns and a major part of the data may be ideal for relational tables. So depending upon the nature of the data, you should decide which part should go to relational tables and whch to XML columns (if any)

     

    Do not go for XML just because XML is supported. Go with XML when you feel that a certain piece of information is better stored in an XML column. Unstructured or semistructured data is ideal for XML columns and other pieces of information should go to relational tables.

     

    regards

    jacob

    Sunday, July 6, 2008 8:28 AM
  • Hi Jacob,
    >So if you really meant XML files (disk files), then I would say NO to it.
    I meant to say XML disk files.

    Thanks a lot for your suggestion. We shall implement the same.

    Thanks & Regards,
    Som.
    Monday, July 7, 2008 4:59 AM