I have the following table in sqlfiddle
a b alat alon blat blon
A X 40 -76 26 -80
B Y 41 -74 24 -81
C Z 42 -73 24 -80
I would like to use a select query to add a numeric distance column.
My current try is
select a,b,alat,alon,blat,blon,
GEOGRAPHY::Point(alat, alon,4326).STDistance(GEOGRAPHY::Point(blat, blon, 4326))
from lat_lon
but I get the error
Incorrect syntax near 'GEOGRAPHY'
How can I include a distance column in my select statement?