Export (0) Print
Expand All

RingN (geography Data Type)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

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

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.

.RingN (expression )

expression

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

SQL Server return type: geography

CLR return type: SqlGeography

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().

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();
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft