| title | MinDbCompatibilityLevel (geometry Data Type) | |
|---|---|---|
| description | MinDbCompatibilityLevel (geometry Data Type) | |
| author | MladjoA | |
| ms.author | mlandzic | |
| ms.date | 08/03/2017 | |
| ms.service | sql | |
| ms.subservice | t-sql | |
| ms.topic | reference | |
| ms.custom |
|
|
| helpviewer_keywords |
|
|
| dev_langs |
|
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]
Returns the minimum database compatibility level that recognizes the geometry data type instance.
.MinDbCompatibilityLevel ( )
[!INCLUDEssNoVersion] return type: int
CLR return type: int
Use MinDbCompatibilityLevel() to test a spatial object for compatibility before changing the compatibility level on a database.
The following example tests a CircularString instance for compatibility with an earlier version of [!INCLUDEssNoVersion]:
DECLARE @g geometry = 'CIRCULARSTRING(3 4, 8 9, 5 6)';
IF @g.MinDbCompatibilityLevel() <= 110
BEGIN
SELECT @g.ToString();
ENDThe following example tests a LineString instance for compatibility with [!INCLUDEsql2008-md]:
DECLARE @g geometry = 'LINESTRING(3 4, 8 9, 5 6)';
IF @g.MinDbCompatibilityLevel() <= 100
BEGIN
SELECT @g.ToString();
END