SQL Flow Field Guide

geography: OGC Static Methods

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

none (documentation, rules or examples)

What changes

Input
none
Output or change
none

Syntax at a glance

n/a (reference page)

Work example

Use geography methods for construction from coordinates, text, markup, or binary input.

Choose input format and SRID, then validate type and coordinate order.

Check your work Both constructors return the same point; WKT uses longitude then latitude, and the WKB constructor receives SRID 4326.

Practice SQL

Open in SQL Flow

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

SELECT geography::STPointFromText('POINT(-122.349 47.651)', 4326).STAsText() AS point_from_wkt, geography::STPointFromWKB(geography::Point(47.651, -122.349, 4326).STAsBinary(), 4326).STAsText() AS point_from_wkb;

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