Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.91 KB

ringn-geography-data-type.md

File metadata and controls

57 lines (45 loc) · 1.91 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom f1_keywords helpviewer_keywords dev_langs monikerRange
RingN (geography Data Type)
RingN (geography Data Type)
MladjoA
mlandzic
03/14/2017
sql
t-sql
reference
ignite-2024
RingN
RingN_TSQL
RingN method
TSQL
=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric

RingN (geography Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

Returns the specified ring of the geography instance: 1 ≤ n ≤ NumRings().

Syntax

.RingN (expression )

Arguments

expression
Is an int expression between 1 and the number of rings in a polygon instance.

Return Value

[!INCLUDEssNoVersion] return type: geography

CLR return type: SqlGeography

Remarks

If the value of the ring index n is less than 1, this method throws an ArgumentOutOfRangeException. The ring index value must be greater than or equal to 1 and should be less than or equal to the number returned by NumRings().

Examples

This example creates a Polygon instance with two rings and returns the second ring.

DECLARE @g geography;  
SET @g = geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653), (-122.357 47.654, -122.357 47.657, -122.349 47.657, -122.349 47.650, -122.357 47.654))', 4326);  
SELECT @g.RingN(2).ToString();  

See Also

Extended Methods on Geography Instances
NumRings (geography Data Type)