Create procedure Proc_GetLocations
(
@lat decimal=00.0,
@lng decimal=00.0
)as
begin
select BM.Name, BL.Lat,BL.Lng,
Geography::Point(@lat, @lng, 4326).STDistance(Geography:: Point(Lat, Lng, 4326)) as Distance_Meters
from Location as BL inner join Master as BM on BL.BusinessId=BM.BusinessID
order by Distance_Meters
end
No comments:
Post a Comment