|
Este artículo se tradujo de forma manual. Mueva el puntero sobre las frases del artículo para ver el texto original.
|
Traducción
Original
|
Quitar índices XML
DROP TABLE T
GO
CREATE TABLE T (Col1 INT PRIMARY KEY, XmlCol XML)
GO
-- Create Primary XML index
CREATE PRIMARY XML INDEX PIdx_T_XmlCol
ON T(XmlCol)
GO
-- Verify the index creation.
-- Note index type is 3 for xml indexes.
-- Note the type 3 is index on XML type.
SELECT *
FROM sys.xml_indexes
WHERE object_id = object_id('T')
AND name='PIdx_T_XmlCol'
-- Drop the index.
DROP INDEX PIdx_T_XmlCol ON T
CREATE TABLE TestTable( Col1 int primary key, Col2 xml (Production.ProductDescriptionSchemaCollection)) GO
CREATE PRIMARY XML INDEX PIdx_TestTable_Col2 ON TestTable(Col2) GO
DROP TABLE T
GO
CREATE TABLE T(Col1 int primary key, XmlColx xml, XmlColy xml)
GO
-- Create XML index on XmlColx.
CREATE PRIMARY XML INDEX PIdx_T_XmlCol
ON T(XmlColx)
GO
-- Create same name XML index on XmlColy.
CREATE PRIMARY XML INDEX PIdx_T_XmlCol
ON T(XmlColy)
WITH (DROP_EXISTING = ON)
-- Verify the index is created on XmlColy.d.
SELECT sc.name
FROM sys.xml_indexes si inner join sys.index_columns sic
ON sic.object_id=si.object_id and sic.index_id=si.index_id
INNER join sys.columns sc on sc.object_id=sic.object_id
AND sc.column_id=sic.column_id
WHERE si.name='PIdx_T_XmlCol'
AND si.object_id=object_id('T')
