I have a table like this
EventTable (IsFar bit, Location geography)
No Problem with Select statement: I can simply run this with no error:
DECLARE @center AS GEOGRAPHY = GEOGRAPHY::Point(50, -160, 4326);
SELECT * FROM EventTable WHERE @center.STDistance(Location) > 100000
Not working with Update statement: but when I want to update the IsFar
column based on its distance from a certain point, it throw exception
Incorrect syntax near '>'.
Here is the code:
DECLARE @center AS GEOGRAPHY = GEOGRAPHY::Point(50, -160, 4326);
UPDATE EventTable SET IsFar = @center.STDistance(Location) > 100000
Anyone can explain why this is not working?