Here's an interesting one. I have address records which have a latitude and longitude - lets say a simple table with:
I know my current position expressed also in degrees latitude and longitude (lets call them variables @Lat and @Long.
So can anyone assist me with some SQL to bring back those Id's which fall within a certain distance. Ideally records within a radius (r) of a circle where I am at the center, or a square at which I am the center if that is easier.
I did find a solution which uses a .Net CLR but I am restricted and not able to use a CLR.