I have a view that contains two fields for latitude and longitude, and I would like to create a new view that converts these lat/lon fields into a geometry/geography field (
SELECT *,
geography::STGeomFromText('POINT(' +
CAST([Longitude] AS VARCHAR(20)) + ' ' +
CAST([Latitude] AS VARCHAR(20)) + ')', 4326) as GEOM,
geography::Point([Latitude], [Longitude], 4326) as SAME_GEOM
FROM view_name
WHERE (latitude <> 0) AND (longitude <> 0)