Skip to content

Instantly share code, notes, and snippets.

@marcoah
Last active April 22, 2018 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoah/f206a4812cd3e8915c0a9798d8bea3a6 to your computer and use it in GitHub Desktop.
Save marcoah/f206a4812cd3e8915c0a9798d8bea3a6 to your computer and use it in GitHub Desktop.
Codigo para pasar Latitud y Longitud de campos double a Geography. SQL Server 2008 en adelante
UPDATE [dbo].[Perforaciones]
SET [Posicion] = Geography::STPointFromText('POINT(' + CAST([LON] AS VARCHAR(20)) + ' ' + CAST([LAT] AS VARCHAR(20)) + ')', 4326)
GO
@marcoah
Copy link
Author

marcoah commented Apr 22, 2018

Pasa de Campos Double (Latitud y Longitud) a un solo campo Geography
SQL Server 2008 en adelante (actualmente probado en SQL Server 2014)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment