Tuesday, 2 January 2018

Add a geometry column for fetching lat long using geojson in sql server

////////
ALTER TABLE TableName  ADD GeoLoc geometry

UPDATE [dbo].[TableName]

SET [GeoLoc] = geometry::STPointFromText('POINT(' + CAST([Long] AS VARCHAR(20)) + ' ' + CAST([Lat] AS VARCHAR(20)) + ')', 4326)

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...