/* === MORE SIMPLER APPROACH ==== */
SELECT ssug.name
, [ssug].[location].STBuffer(5000) UG
FROM @SQLServerUGs AS ssug
UNION ALL
SELECT [ssug].[name] + '->' + ssug2.name AS name
, GEOGRAPHY::Point((ssug.location.Lat + ssug2.location.Lat) * 0.5,(ssug.location.Long + ssug2.location.Long) * 0.5,
4326).STBuffer(1000) HalfwaySTBuffer
FROM @SQLServerUGs AS ssug
JOIN @SQLServerUGs AS ssug2
ON ssug.name ssug2.name
6 People are following this question.