SQL Flow Field Guide

geography.M

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

spatial method M (instance.M(...))

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

.M

Work example

Use geography.M to read the measure ordinate from a measured instance.

Check HasM and document what the measure represents. Keep the geography type and SRID in the review.

Check your work The M ordinate is 12 and represents a user-defined measure, not elevation.

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.M AS route_measure FROM (VALUES (geography::STGeomFromText('POINT(-122.34900 47.65100 10.3 12)', 4326))) AS p(shape);

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