SQL Flow Field Guide

geometry.STEndpoint

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

spatial method STEndpoint (instance.STEndpoint(...))

What changes

Input
spatial instance (and arguments)
Output or change
geometry
Return type
SQL Server return type: geometry CLR return type: SqlGeometry Open Geospatial Consortium (OGC) type: Point

Syntax at a glance

.STEndPoint ( )

Work example

Use geometry.STEndpoint to read the final point of a line.

Check the instance type and handle an empty line. Keep the geometry type and SRID in the review.

Check your work The final coordinate is POINT (3 4), five planar units from the origin.

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'LINESTRING(0 0, 3 4)', 0);
SELECT @shape.STEndPoint().STAsText() AS line_end_point,
       @shape.STSrid AS source_srid,
       @shape.STIsValid() AS source_is_valid;

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