Jul 31, 2008

Limitations of the XML Data Type

Hi all,

I found the limitation of XML Data Type introduced in SQL Server 2005.

Although the XML datatype is treated like many other datatypes in SQL Server 2005, there are specific limitations to how it is used. These limitations are:

  1.    XML types cannot convert to text or ntext data types.

  2.    No data type other than one of the string types can be cast to XML.

  3.    XML columns cannot be used in GROUP BY statements.

  4.    Distributed partitioned views or materialized views cannot contain XML data types.

  5.    Use of the sql_variant instances cannot include XML as a subtype.

  6.    XML columns cannot be part of a primary or foreign key.

  7.    XML columns cannot be designated as unique.

  8.    Collation (COLLATE clause) cannot be used on XML columns.

  9.    XML columns cannot participate in rules.

  10.    The only built-in scalar functions that apply to XML columns are ISNULL and COALESCE. No other scalar built-in functions are supported for use against XML types.

  11.    Tables can have only 32 XML columns.

  12.    Tables with XML columns cannot have a primary key with more than 15 columns.

  13.    Tables with XML columns cannot have a timestamp data type as part of their primary key.

  14.    Only 128 levels of hierarchy are supported within XML stored in the database.

No comments: