HeftSteady
Old Hand
Points: 347
More actions
April 1, 2026 at 10:51 pm
#4759880
I have a table with latitude longitude in the format. 45.123456 , -111.123456 , Primary Key . I want to find all ids within a radius in miles.
Thanks in advance . Have a great day.
pietlinden
SSC Guru
Points: 63650
April 2, 2026 at 12:46 am
#4759921
You use the (longitude, latitude) to create/define a @Point. and then you use STDistance to calculate the distance between them.
STDistance (geography Data Type) - SQL Server | Microsoft Learn
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply