Query Points Using SQL Server 2008 Geography Type

I have a table with the type of geography, and I want to run a query to find all rows within 25 miles of a specific lat / long. What will the request look like for this?

+3
source share
1 answer

Here is how I did it:

select *
from local_events
where _your_geography_column_.STDistance(geography::Point(_your_lat_,_your_long_, 4326)) < ((_your_miles_ * 1000) * 0.621371192)
+1
source

Source: https://habr.com/ru/post/1744525/


All Articles