Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

STIsValid (geometry Data Type)

 

Applies To: SQL Server 2014, SQL Server 2016 Preview

Returns true if a geometry instance is well-formed, based on its Open Geospatial Consortium (OGC) type. Returns false if a geometry instance is not well-formed.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.


.STIsValid ( )

SQL Server return type: bit

CLR return type: SqlBoolean

The OGC type of a geometry instance can be determined by invoking STGeometryType().

SQL Server produces only valid geometry instances, but allows for the storage and retrieval of invalid instances. A valid instance representing the same point set of any invalid instance can be retrieved using the MakeValid() method.

The following example creates a geometry instance and uses STIsValid() to test if the instance is valid.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 2 2, 1 0)', 0);
SELECT @g.STIsValid();
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft