title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | dev_langs | ||
---|---|---|---|---|---|---|---|---|---|---|---|
MinDbCompatibilityLevel (geometry Data Type) |
MinDbCompatibilityLevel (geometry Data Type) |
MladjoA |
mlandzic |
08/03/2017 |
sql |
t-sql |
reference |
|
|
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]
Returns the minimum database compatibility level that recognizes the geometry data type instance.
.MinDbCompatibilityLevel ( )
[!INCLUDEsql-server-tsql-previous-offline-documentation]
[!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();
END
The 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