With geography datatype you can create system where you can filter locations on bases of distance between them. Also it make very easy to calculate distance between 2 location points. Along with that you can use any GPS standard system using SRID parameter in methods offered by Geography datatype.
For script check below link:
Building system where you can search locations near by N miles or kilometer
Watch video Calculating distance between two Points ( Longitude and Latitude) in SQL using GEOGRAPHY type online without registration, duration hours minute second in high quality. This video was added by user techsapphire 10 April 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 46,509 once and liked it 191 people.