A MultiPolygon instance is a collection of zero or more Polygon instances.
The illustration below shows examples of MultiPolygon instances.
As shown in the illustration:
The following example shows the creation of a geometry MultiPolygon instance and returns the Well-Known Text (WKT) of the second component.
geometry
MultiPolygon
DECLARE @g geometry; SET @g = geometry::Parse('MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0), (1 1, 1 2, 2 1, 1 1)), ((9 9, 9 10, 10 9, 9 9)))'); SELECT @g.STGeometryN(2).STAsText();
This example instantiates an empty MultiPolygon instance.
DECLARE @g geometry; SET @g = geometry::Parse('MULTIPOLYGON EMPTY');