SQL Flow Field Guide

geometry.STY

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

spatial method STY (instance.STY(...))

What changes

Input
spatial instance (and arguments)
Output or change
SQL Server type: float
Return type
SQL Server type: float CLR type: SqlDouble

Syntax at a glance

.STY

Work example

Use geometry.STY to read the Y coordinate of a geometry point.

Confirm a point instance and document coordinate reference and units. Keep the geometry type and SRID in the review.

Check your work STY returns 4, the second planar coordinate. It is not necessarily latitude.

Practice SQL

Open in SQL Flow

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

-- Planar geometry. SRID 0 coordinates here are synthetic units, not metres.
DECLARE @shape geometry;
SET @shape = geometry::STGeomFromText(N'POINT(3 4)', 0);
SELECT @shape.STY AS y_coordinate,
       @shape.STSrid AS source_srid,
       @shape.STIsValid() AS source_is_valid;

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