Created
August 23, 2013 21:27
-
-
Save brazilnut2000/6324209 to your computer and use it in GitHub Desktop.
SQL: Populate GeoLocation table from Latitude and Longitude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Assumes table has populated Latitude and Longitude columns | |
Populates the GeoLocation column from Lat ad Lon | |
*/ | |
UPDATE [dbo].[TableX] | |
SET [GeoLocation] = geography::Parse('POINT(' + CAST([Longitude] AS VARCHAR(20)) + ' ' + | |
CAST([Latitude] AS VARCHAR(20)) + ')') | |
GO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment