Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get type of geometry in SQL Server?

I'm working with the geometry types in SQL Server and I'm wondering if there's any function to tell what kind of geometry something is (point, multipoint, polygon, etc.)?

like image 911
Brendan Long Avatar asked Feb 07 '11 18:02

Brendan Long


1 Answers

Looks like you want STGeometryType:

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

like image 178
AakashM Avatar answered Jan 03 '23 13:01

AakashM