Q
Problem solve Get help with specific problems with your technologies, process and projects.

Storing XML data in SQL Server 2005

SQL Server 2005 Expert Adam Machanic discusses storing XML data in SQL Server 2005 using the new XML datatype.

Should I store all of my XML data in SQL Server 2005 using the new XML data type?
Much like CLR UDTs ( link to UDT FAQ ), XML is now a new first-class datatype in SQL Server 2005. Developers may be tempted to use this datatype in order to avoid having to write code to "shred" XML data into tables (i.e. instead of using OPENXML to populate tables with the data.)

Unfortunately, using the XML datatype like this has many of the same problems as representing data in user-defined types. Developers should keep performance in mind, as querying a node of an XML column will require the engine to evaluate a separate XML query for each row of the table. Normalization issues are also present, just as when using CLR UDTs. Ensuring data integrity will be extremely difficult in databases that make too much use of the XML datatype.


Do you have comments on this Ask the Expert Q&A? Let us know.
This was last published in November 2005

Dig Deeper on Microsoft SQL Server 2005

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close