Calculating Distances Between Latitude and Longitude â T-SQL â Haversine. Iâve got lots of lat/long information for my Silverlight 2 application and Iâm now tinkering with getting the elevation view working in my spare time.