Skip to content

Latest commit

 

History

History
14 lines (13 loc) · 497 Bytes

7.md

File metadata and controls

14 lines (13 loc) · 497 Bytes

Consider the following code:

DECLARE @g1 geometry;  
DECLARE @g2 geometry;  
SET @g1 = geometry::STGeomFromText (
    'POINT (4 4)',0);
SET @g2 = geometry::STGeomFromText (
    'LINESTRING (0 0, 1 1, 0 1, 1 0)',0);
   
SELECT @g2.STEquals(@g2.STDifference(@g1));
-- expected{1}, actual{0}

The g2 differenced by g1 that is not related to g2 needs to be equal to g2. Because the relationship between g1 and g2 is disjoint. But SQLServer doesn't consider that they are equal.