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

Returns the Open Geospatial Consortium (OGC) type name represented by a geography instance.

.STGeometryType ()

SQL Server return type: nvarchar(4000)

CLR return type: SqlString

The OGC type names that can be returned by STGeometryType() are Point, LineString, Polygon, GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon.

The following example uses STGeometryType() to create a Polygon instance and confirms that it is a polygon.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326);
SELECT @g.STGeometryType();
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