Create index on XML column : XML « XML « SQL Server / T-SQL Tutorial






3> CREATE TABLE dbo.VisioDocs
4> (
5>   id  INT NOT NULL,
6>   doc XML NOT NULL
7> );
8> GO
1>
2>
3> ALTER TABLE dbo.VisioDocs
4>   ADD CONSTRAINT PK_VisioDocs PRIMARY KEY CLUSTERED (id);
5> GO
1> CREATE PRIMARY XML INDEX idx_xml_primary ON dbo.VisioDocs(doc);
2> GO
Msg 1934, Level 16, State 1, Server J\SQLEXPRESS, Line 1
CREATE XML INDEX failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed column
s and/or query notifications and/or xml data type methods.
1> CREATE XML INDEX idx_xml_path ON VisioDocs(doc)
2>   USING XML INDEX idx_xml_primary
3>   FOR PATH;
4> GO
Msg 1934, Level 16, State 1, Server J\SQLEXPRESS, Line 1
CREATE XML INDEX failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed column
s and/or query notifications and/or xml data type methods.
1>
2> drop table VisioDocs;
3> GO








24.1.XML
24.1.1.XML type column
24.1.2.Insert XML data to database
24.1.3.Insert XML data to a XML type column
24.1.4.Creating xml Data Type Columns and insert data
24.1.5.Create index on XML column
24.1.6.Load XML data from a file to table
24.1.7.Modifying XML Data