SALES: 1-800-867-1380

CREATE SPATIAL INDEX (Azure SQL Database)

This topic is OBSOLETE. You can find the most current version in the SQL 14 Transact-SQL Reference.

ImportantImportant
This topic is not maintained. For the current version, see CREATE SPATIAL INDEX (Transact-SQL).

Creates a spatial index on a specified table and column in the current database. An index can be created before there is data in the table.

Syntax Conventions (Azure SQL Database)


CREATE SPATIAL INDEX index_name 
    ON <object> (spatial_column_name ) 
    { 
      [ USING <geometry_grid_tessellation> ] 
          WITH ( <bounding_box> 
                [ [,] <tesselation_parameters> [,... n ] ] 
                [ [,] <spatial_index_option> [,... n ] ] ) 
     | [ USING <geography_grid_tessellation> ] 
          [ WITH ( [ <tesselation_parameters> [,... n ] ] 
                   [ [,] <spatial_index_option> [,... n ] ] ) ] 
    } 


[ ; ]

<object> ::=
{
    [database_name. [schema_name ] . | schema_name. ] 
                table_name<geometry_grid_tessellation> ::= 
{ GEOMETRY_GRID }
  
<bounding_box> ::= 
BOUNDING_BOX =( {
        xmin, ymin, xmax, ymax 
   | <named_bb_coordinate>, <named_bb_coordinate>, <named_bb_coordinate>, <named_bb_coordinate> 
  } )<named_bb_coordinate> ::= { XMIN = xmin | YMIN = ymin | XMAX = xmax | YMAX=ymax }

<tesselation_parameters> ::= 
{ 
    GRIDS = ( { <grid_density> [ ,... n ] | <density>, <density>, <density>, <density>  } ) 
  | CELLS_PER_OBJECT = n 
}

<grid_density> ::= 
{
     LEVEL_1 = <density> 
  |  LEVEL_2 = <density> 
  |  LEVEL_3 = <density> 
  |  LEVEL_4 = <density> 
}

<density> ::= { LOW | MEDIUM | HIGH }

<geography_grid_tessellation> ::= 
{ GEOGRAPHY_GRID }
  
<spatial_index_option> ::= 
{
    IGNORE_DUP_KEY = OFF
  | STATISTICS_NORECOMPUTE = { ON | OFF }
  | DROP_EXISTING = { ON | OFF }
  | ONLINE = OFF 
}

This syntax diagram demonstrates the supported arguments and options in Microsoft Azure SQL Database.

Microsoft Azure SQL Database does not support the following arguments and options with the CREATE SPATIAL INDEX statement:

  • ON Keyword for

    • partition_schema_name

    • filegroup name

    • default

  • relational_index_option:

    • PAD_INDEX

    • FILLFACTOR

    • SORT_IN_TEMPDB

    • ALLOW_ROW_LOCKS

    • ALLOW_PAGE_LOCKS

    • MAXDOP

  • Backward-compatible relational index

noteNote
Microsoft Azure SQL Database supports the three-part name format database_name.[schema_name].object_name when the database_name is the current database or the database_name is tempdb and the object_name starts with #.

Microsoft Azure SQL Database does not support four-part names.

For more information about the arguments and the CREATE SPATIAL INDEX statement, see CREATE SPATIAL INDEX (Transact-SQL) in SQL Server Books Online.

In Microsoft Azure SQL Database, indexes cannot be created on tables or views in another database.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft