[GIS] Geography for Sql Server STIsValid() getting error

geography-data-typesql server

I am getting the following error
Could not find method 'STIsValid' for 'Microsoft.SqlServer.Types.SqlGeography' in assembly 'Microsoft.SqlServer.Types' on the following query.

select ogr_geog from dbo.pod_1730_essential_energy
where ogr_geog.STIsValid() = 0 and ogr_geog is not null

All my other Spatial methods work. The ogr_geog column is a geography type.
Does anybody know the root of this error?

Best Answer

STIsValid() was added to the Geography type with SQL Server 2012.

If you are using SQL Server 2008 this method only exists for the Geometry data type