DECLARE @Latitude float = 8.4827
DECLARE @Longitude float = 76.9192
DECLARE @ID int = 1
UPDATE [dbo].[LocationCopy]
SET
LocationGeography = geography::STGeomFromText('POINT('+CAST(@Latitude AS Varchar)+' '+CAST(@Longitude AS Varchar)+' )', 4326)
WHERE LocationID = @ID
SELECT CAST(LocationGeography AS varchar(max)) FROM dbo.LocationCopy
GO
DECLARE @Latitude float = 8.4827
DECLARE @Longitude float = 76.9192
DECLARE @ID int = 1
UPDATE [dbo].[LocationCopy]
SET
LocationGeography = geography::Point(@Latitude, @Longitude, 4326)
WHERE LocationID = @ID
SELECT CAST(LocationGeography AS varchar(max)) FROM dbo.LocationCopy
GO
After executing the updation with geography::STGeomFromText method
there is no change in the latitude,longitude order in the result
POINT (8.4827 76.9192)
but when i use geography::Point method there is a change in the latitude,longitude order in the result
POINT (76.9192 8.4827)
Why this happen?I am planning to use this to find nearby places, if the order get change doesn't it affect the distance.
One more question isn't the POINT method is fastest as there is no conversion..