SQL Flow Field Guide

geography.STEquals

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

spatial predicate STEquals

What changes

Input
one or two spatial instances
Output or change
bit
Return type
SQL Server return type: bit CLR return type: SqlBoolean

Syntax at a glance

.STEquals ( other_geography )

Work example

Use geography.STEquals to test whether two shapes represent the same point set.

Compare matching SRIDs and do not compare formatted text. Confirm both values use the same SRID before comparing or combining them.

Check your work The two point instances describe the same location and share SRID 4326, so the result is 1.

Practice SQL

Open in SQL Flow

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

SELECT a.shape.STEquals(b.shape) AS same_location FROM (VALUES (geography::Point(47.651, -122.349, 4326))) AS a(shape) CROSS JOIN (VALUES (geography::STGeomFromText('POINT(-122.349 47.651)', 4326))) AS b(shape);

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