STNumGeometries (geometry Data Type)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Returns the number of geometries that comprise a geometry instance.

Syntax

  
.STNumGeometries ( )  

Return Types

SQL Server return type: int

CLR return type: SqlInt32

Remarks

This method returns 1 if the geometry instance is not a MultiPoint, MultiLineString, MultiPolygon, or GeometryCollection instance, and 0 if the geometry instance is empty.

[!NOTE]
If a GeometryCollection has nested empty elements, STNumGeometries() will not return 0. Though the elements in the GeometryCollection instance are empty, the instance itself is not an empty set.