NUMINTERIORRINGS() — Returns the number of interior rings within a polygon GEOGRAPHY value.
NUMINTERIORRINGS( polygon )
The NUMINTERIORRINGS() function returns the number of interior rings within a polygon GEOGRAPHY value. Polygon GEOGRAPHY values can contain multiple polygons: one and only one outer polygon and one or more optional inner polygons that define "holes" in the outer polygon. The NUMINTERIORRINGS() function counts the number of inner polygons and returns the result as an integer value.