Current SQL Server Blog Articles
In Oracle one can gest for invalid geometries via the SDO_GEOM package’s VALIDATE_GEOMETRY (or VALIDATE_GEOMETRY_WITH_CONTEXT) function. To use it one does the following:
Where 0.5 is the minimum distance between two vertices (I have deliberately not described the other overloaded version of this function that uses an DIMINFO structure).
In SQL Server, if you execute a SELECT statement and that statement processes invalid geometry objects you will get an error message like this:
SQL Server Katmai includes the OGC function STIsValid() which can be used to find invalid geometries. Katmai also includes an “extended” (non-OGC 1.1) function called MakeValid() which can be uses to correct any geometries are STIsValid() report as invalid. To correct invalid geometries one can do this:
Note that the MakValid function has no parameters so one cannot supply SQL Server with coordinate precision data to control the “shift slightly” warning in the above exception.