Calculate the Geographical Distance Between Two Cities in SQL Server
Nuestro buen amigo Daniel Calbimonte nos comparte su artículo:
Calculate the Geographical Distance Between Two Cities in SQL Server
Problem
Some SQL Server DBAs complain that it is hard to start working with the Spatial Data Types without using a real world example. In today's tip I am going to show how to find the distance between different cities using the SQL Server geography data type and Google Earth.
Solution
Requirements for calculating the distance between two cities
In this tip I am using SQL Server 2012, but this sample code should work with SQL Server 2008 as well. Earlier versions of SQL Server did not include the geography data type. Another tool that I've installed for this tip is Google Earth, but you can use other tools like findlatitudelongitud.com, itouchmap.com, etc.
Getting started with the calculations in SQL Server
Ver más aquí.
Gracias.
Fernando García Loera (Community Program Manager – Latin America Region)