geometry.STIntersects
spatial predicate STIntersects
What changes
- Input
- one or two spatial instances
- Output or change
- bit
- Return type
- SQL Server return type: bit CLR return type: SqlBoolean
Syntax at a glance
.STIntersects ( other_geometry )
Work example
Use geometry.STIntersects to test whether two shapes share at least one point.
Check matching SRIDs and consider a spatial index for supported table predicates. Confirm both values use the same SRID before comparing or combining them.
Check your work The result is nullable bit, so test explicitly for 1. Incompatible SRIDs can make a two-instance result null. For this geometry result, verify coordinate units in the planar reference.
Practice SQL
Open in SQL FlowSELECT geometry::STGeomFromText('POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))', 0).STIntersects(geometry::Point(2, 2, 0)) AS intersects;
Open Microsoft Learn for full syntax, permissions, and details for your version.