I am trying to get a Geometry query to work. A similar Geography query works fine but I must work with a table that uses a Geometry type. Although the Geography version returns lots of records as expected, I cannot get the Geometry version to return any records. Both tables have exactly the same latitude and longitude records .
This Geography query works fine:
DECLARE @home GEOGRAPHYSET @home = GEOGRAPHY::STPointFromText('POINT(-0.7799193 51.3083162 )', 4326);SELECT OutwardCode, InwardCode, Latitude, LongitudeFROM dbo.PostCodeDataWHERE GeoLocation.STDistance(@home)
This Geography query works fine:
DECLARE @home GEOGRAPHYSET @home = GEOGRAPHY::STPointFromText('POINT(-0.7799193 51.3083162 )', 4326);SELECT OutwardCode, InwardCode, Latitude, LongitudeFROM dbo.PostCodeDataWHERE GeoLocation.STDistance(@home)