DECLARE @Latitude float = 8.4827DECLARE @Longitude float = 76.9192DECLARE @ID int = 1UPDATE [dbo].[LocationCopy]SET LocationGeography = geography::STGeomFromText('POINT('+CAST(@Latitude AS Varchar)+' '+CAST(@Longitude AS Varchar)+' )', 4326) WHERE LocationID = @IDSELECT CAST(LocationGeography AS varchar(max)) FROM dbo.LocationCopyGODECLARE @Latitude float = 8.4827DECLARE @Longitude float = 76.9192DECLARE @ID int = 1UPDATE [dbo].[LocationCopy]SET LocationGeography = geography::Point(@Latitude, @Longitude, 4326) WHERE LocationID = @IDSELECT CAST(LocationGeography AS varchar(max)) FROM dbo.LocationCopyGO
Finally, and perhaps most important, is the order in which the coordinates are entered in the data type. The functions used for the geography data types view coordinates as {X,Y} coordinates. In order to properly document the locations of the earthquakes I will need to present the data as longitude first, then latitude, which is different from how most people think of earth-related coordinates.