Assuming you are looking for the hypotenuse which is SQRT(Power(L,2)+Power(H,2)
To be clear, this hypotenuse does NOT account for the curvature of the earth.
Here is a little example which shows both.
declare @lat1 float = 22.30634
declare @lng1 float = 113.92934
declare @alt1 float = 125
declare @lat2 float = 58.31962
declare @lng2 float = -157.54788
declare @alt2 float = 35000
SELECT JustLatLng = geography::Point(@lat1, @lng1, 4326).STDistance(geography::Point(@lat2, @lng2, 4326))
,WithAlt = SQRT(Power(geography::Point(@lat1, @lng1, 4326).STDistance(geography::Point(@lat2, @lng2, 4326)),2)
+Power((@alt1-@alt2)*0.3048,2))
Returns
JustLatLng WithAlt
7838823.94282909 7838831.1502063 --<< delta of 7.20737721