Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By RBarry Young,
With the advent of GPS and other widely available global location data, there is an increasing need to be able to accurately calculate the distance between two points over the earth's surface, from latitudes and longitudes. This SQL function does just that ,returning the distance in miles.
this function has several other advantages as well, first, it is very accurate, usually 4 to 5 decimal places. and secondly, it is much faster than most other, less accurate, algorithims. (if even more speed is needed, then include this calculation in-line in the body of your query.)
count of rows in table is not accurate.
Problem achieving accurate percentage figures after rounding
As a SQL Server DBA you should know that your code is stored in syscomments by default. While most D...
The end of a year is a time for reflection, but it’s also a time for running full-pelt at the new ye...
I tried performing datediff on two strings converted into datetimes and found that it simply subtrac...