SQL Flow Field Guide

geography.HasM

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

spatial method HasM (instance.HasM(...))

What changes

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

Syntax at a glance

.HasM

Work example

Use geography.HasM to check whether measured coordinates are present.

Check this before reading M and keep route measures distinct from elevation. Keep the geography type and SRID in the review.

Check your work HasM is 1 because the sample point carries measure value 12.

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.HasM AS has_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.