Search code examples
sql-serverxmlindexed-view

Is it possible to create an indexed view from Xml Data in Sql Server 2008?


I see from the 2005 documentation that you cannot create an indexed view from an Xml column.

Is this possible in 2008 or 2008R2? I can't find any documentation saying that it is something that was added but am looking for confirmation and I don't have handy access to a 2008 environment at the moment.

EDIT

My motivation behind this is that the amount of Xml is growing to the point where SSRS reports which aggregate data from the Xml are becoming slow.


Solution

  • I don't believe this is possible. Without a better explanation of what you are trying to do, one suggestion I can offer is to pull the XML apart before insert (perhaps using an instead of trigger, or doing this shredding at the application layer) and storing the part(s) you want to use for the indexed view in separate non-XML columns.