SQL Flow Field Guide

geography.RingN

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

spatial method RingN (instance.RingN(...))

What changes

Input
spatial instance (and arguments)
Output or change
geography
Return type
SQL Server return type: geography CLR return type: SqlGeography

Syntax at a glance

.RingN (expression )

Work example

Use geography.RingN to read one ring from a geography polygon.

Use a one-based index and verify that it is the intended boundary. Keep the geography type and SRID in the review.

Check your work RingN uses a one-based index; ring 2 is the second ring in this two-ring polygon.

Practice SQL

Open in SQL Flow

Open the SQL for a walkthrough. Run the example in SQL Server to check its result.

SELECT p.shape.RingN(2).STAsText() AS second_ring_wkt FROM (VALUES (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))) AS p(shape);

Open Microsoft Learn for full syntax, permissions, and details for your version.