Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 STLength (geography Data Type)
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
SQL Server 2008 Books Online (October 2009)
STLength (geography Data Type)

Returns the total length of the elements in a geography instance or the geography instances within a GeometryCollection.

.STLength ( )

SQL Server return type: float

CLR return type: SqlDouble

If a geography instance is closed, its length is calculated as the total length around the instance; the length of any polygon is its perimeter, and the length of a point is 0. The length of a GeometryCollection is found by calculating the sum of the lengths of all of the geography instances contained within the collection.

The following example creates a LineString instance and uses STLength() to find the length of the instance.

DECLARE @g geography;
SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);
SELECT @g.STLength();
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker