Skip to content

Latest commit

 

History

History
75 lines (58 loc) · 3.77 KB

sp-help-spatial-geometry-index-xml-transact-sql.md

File metadata and controls

75 lines (58 loc) · 3.77 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_help_spatial_geometry_index_xml (Transact-SQL)
sp_help_spatial_geometry_index_xml (Transact-SQL)
markingmyname
maghan
06/10/2016
sql
system-objects
reference
sp_help_spatial_geometry_index_xml_TSQL
sp_help_spatial_geometry_index_xml
sp_help_spatial_geometry_index_xml procedure
TSQL

sp_help_spatial_geometry_index_xml (Transact-SQL)

[!INCLUDE SQL Server]

Returns the names and values for a specified set of properties about a geometry spatial index. You can choose to return a core set of properties or all properties of the index.

Results are returned in an XML fragment that displays the name and value of the properties selected.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

  
sp_help_spatial_geometry_index [ @tabname =] 'tabname'   
     [ , [ @indexname = ] 'indexname' ]   
     [ , [ @verboseoutput = ]'{ 0 | 1 }]   
     [ , [ @query_sample = ] 'query_sample' ]   
     [ ,.[ @xml_output = ] 'xml_output' ]   

Arguments

See Arguments and Properties of Spatial Index Stored Procedures.

Properties

See Arguments and Properties of Spatial Index Stored Procedures.

Permissions

User must be a member of the public role. Requires READ ACCESS permission on the server and the object.

Remarks

Properties containing NULL values are not included in the XML return set.

Example

The following example uses sp_help_spatial_geometry_index_xml to investigate the spatial index SIndx_SpatialTable_geometry_col2 defined on table geometry_col for the given query sample in @qs. This example returns the core properties of the specified index in an XML fragment that displays the name and value of the properties selected.

An XQuery is then run on the result set, returning a specific property.

DECLARE @qs geometry  
        ='POLYGON((-90.0 -180.0, -90.0 180.0, 90.0 180.0, 90.0 -180.0, -90.0 -180.0))';  
DECLARE @x xml;  
EXEC sp_help_spatial_geometry_index_xml 'geometry_col', 'SIndx_SpatialTable_geometry_col2', 0, @qs, @x output;  
SELECT @x.value('(/Primary_Filter_Efficiency/text())[1]', 'float');  

Similar to sp_help_spatial_geometry_index, this stored procedure provides simpler programmatic access to the properties of a spatial index and reports the result set in XML.

Requirements

See Also

Arguments and Properties of Spatial Index Stored Procedures
Spatial Index Stored Procedures
sp_help_spatial_geometry_index
Spatial Indexes Overview
Spatial Data (SQL Server)
XQuery Basics
XQuery Language Reference