SQL Flow Field Guide

geography.IsValidDetailed

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

spatial method IsValidDetailed (instance.IsValidDetailed(...))

What changes

Input
spatial instance (and arguments)
Output or change
nvarchar(max)
Return type
SQL Server return type: nvarchar(max) CLR return type: string

Syntax at a glance

.IsValidDetailed()

Work example

Use geography.IsValidDetailed to read a diagnostic for an invalid spatial value.

Review the reason before deciding whether MakeValid is acceptable. Keep the geography type and SRID in the review.

Check your work The bow-tie polygon reports invalidity code 24409 because its ring enters its own interior.

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.IsValidDetailed() AS validity_report FROM (VALUES (CAST('POLYGON((2 2, 4 4, 4 2, 2 4, 2 2))' AS geography))) AS p(shape);

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