Database Reference
In-Depth Information
Listing 11-4.
Primary XML index on untyped XML
create table dbo.XmlDemo
(
ID int not null identity(1,1),
XMLData xml not null,
constraint PK_XmlDemo
primary key clustered(ID)
);
insert into dbo.XMLDemo(XMLData)
values(/*XML From Listing 11-1*/);
create primary xml index XML_Primary_XmlDemo
on dbo.XmlDemo(XMLData);
Now let's look at the internal structure of the primary XML index. You can find the name of the internal table
that stores the index by querying the
sys.internal_tables
view. You will see results similar to the ones shown
in Figure
11-1
.
Figure 11-1.
sys.internal_tables content
Now if you query the data from the primary XML index table, you will see the results shown in Figure
11-2
.
You need to connect through a dedicated admin connection to be able to do this.
Figure 11-2.
Primary XML Index data (untyped XML)