Assuming you have lat and long dot values ββin db.
select * from yourtable where SQRT ( POWER((yourtable.lat - reflat) * COS(reflat/180) * 40000 / 360, 2) + POWER((yourtable.long - reflong) * 40000 / 360, 2)) < radiusofinterest
reflat and reflong are the point from which you want to know close places. radiusinterinterest is the distance from this point. 40,000 is the circumference of the earth. you can use more accurate numbers.
I havent checked the syntax with SQLServer though .... so there might be some errors.
cos (reflat) adjusts the circle based on the lat you are in. It should work fine at shorter distances.
source share