|Data Access / Supported Data Sources|
Microsoft SQL Server is a relational database with spatial capabilities.
Spectrum Spatial treats a SQL Server data source as a read-write data source.
The SQL Server data source provider follows the same rules as the JDBC data source provider when mapping a non-spatial JDBC type to Spectrum Spatial’s type system. See the SQL Server documentation for which SQL Server data types are mapped to JDBC.
The SQL Server geometry and geography data types are the spatial data equivalent to Spectrum Spatial's supported data types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
Determining the spatial metadata is done in several steps. The first step looks at the MAPINFO_MAPCATALOG table in the MAPINFO schema and if an entry exists identifies the geometry column in the SQL Server table and the style column. If the table is identified as being an X/Y table then the two columns identified as the X and Y columns will be “fused” together into a geometry column in the Spatial table with the SRID of the coordinate system specified in the MAPINFO_MAPCATALOG. If the MAPINFO_MAPCATALOG does not exists or the table to be opened does not have an entry then the INFORMATION_SCHEMA.TABLES table is consulted for the name of the spatial column. The SRID of the column is taken from the first non-null geometry in the table.
Spectrum Spatial follows the same rules as the JDBC data source provider for determining the primary key.
Spectrum Spatial follows the same rules as the JDBC data source provider in determining whether a column is read-only. It also marks Identity columns as read-only.
MS SQL Server supports the same non-spatial functions and operators as the JDBC data source provider.
MS SQL Server supports the following spatial operators:
For more information see the appendix Delegation to Data Source Providers.
For SQL Server, volatility is any change to the table's schema, such as adding or dropping a column or changing an index on a column. If it has changed, Spectrum Spatial will flush the metadata about the table from the cache and reload it before proceeding with the data access operation. See Data Source Volatility for more information.
SQL Server tables can be accessed as XY tables. See XY Table Support.