It has always been possible to work with geospatial data in SQL Server using built-in geometric and trigonometric functions such as SIN(), COS(), and ACOS(). However, SQL Server 2008’s spatial data types made complex spatial queries a lot more accessible to those of us who don’t remember what a cosine actually is. In this article, I will show you how to use these built-in functions within a user-defined function (UDF) to illustrate the traditional method of calculating distances between geographic points. Read More