Get places in radius of a certain point using SQL geography
问题 I have an SQL table column with the Geography type: create table dbo.Events ( Id int identity not null constraint PK_Events_Id primary key clustered (Id), Localization geography not null ); How can I get all events in a radius of 40 km? Is this possible? Thank You, Miguel 回答1: Assuming you have latitude and longitude of the point from which you want to search: DECLARE @Origin GEOGRAPHY, -- distance defined in meters @Distance INTEGER = 40000; -- center point SET @Origin = GEOGRAPHY: