Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created July 19, 2016 01:30
Show Gist options
  • Save rms1000watt/6145b357b7110fdc69c76c3c4a70aa58 to your computer and use it in GitHub Desktop.
Save rms1000watt/6145b357b7110fdc69c76c3c4a70aa58 to your computer and use it in GitHub Desktop.
SQL Server Lat Long to Geography
-- http://www.sql-server-helper.com/sql-server-2008/convert-latitude-longitude-to-geography-point.aspx
UPDATE [Table1]
SET [GeoLocation] = geography::STPointFromText('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + CAST([Latitude] AS VARCHAR(20)) + ')', 4326)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment