title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_db_selective_xml_index (Transact-SQL) |
sp_db_selective_xml_index enables and disables selective XML index (SXI) functionality on a SQL Server database. |
markingmyname |
maghan |
randolphwest |
07/04/2024 |
sql |
system-objects |
reference |
|
|
|
[!INCLUDE SQL Server]
Enables and disables selective XML index (SXI) functionality on a [!INCLUDE ssNoVersion] database. If called without any parameters, the stored procedure returns 1
if SXI is enabled on a particular database.
Note
In [!INCLUDE sssql14-md] and later versions, the SXI functionality can't be disabled. [!INCLUDE ssNoteDepFutureAvoid]
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_db_selective_xml_index
[ [ @dbname = ] N'dbname' ]
[ , [ @selective_xml_index = ] 'selective_xml_index' ]
[ ; ]
The name of the database on which to to enable or disable selective XML index. @dbname is sysname, with a default of NULL
.
If @dbname is NULL
, the current database is assumed.
Determines whether to enable or disable the index. @selective_xml_index is varchar(6), with a default of NULL
, and can be one of the following values: ON
, OFF
, TRUE
, or FALSE
. Any other value raises an error.
1
if the SXI is enabled on a particular database, 0
if disabled.
The following example enables SXI on the current database.
EXEC sys.sp_db_selective_xml_index
@dbname = NULL
, @selective_xml_index = N'on';
GO
The following example enables SXI on the [!INCLUDE sssampledbobject-md] database.
EXECUTE sys.sp_db_selective_xml_index
@dbname = N'AdventureWorks2022'
, @selective_xml_index = N'true';
GO
The following example disables SXI on the current database.
EXECUTE sys.sp_db_selective_xml_index
@dbname = NULL
, @selective_xml_index = N'off';
GO
The following example disables SXI on the [!INCLUDE sssampledbobject-md] database.
EXECUTE sys.sp_db_selective_xml_index
@dbname = N'AdventureWorks2022'
, @selective_xml_index = N'false';
GO
The following example detects if SXI is enabled, and returns 1
if SXI is enabled.
EXECUTE sys.sp_db_selective_xml_index;
GO