[GIS] Migrate datatypes from geometry to geography in MS SQL

arccatalogarcgis-10.2enterprise-geodatabasesql server

I have three ESRI feature classes (POINT, LINE and POLYGON) that contain a geometry datatype column with data in a projected coordinate system. I'm looking for a way that I can convert & project from Geometry datatype to Geography.

Does anyone know of a tool or script I can use to convert all records permanently?

My research has show that I will not be able to do this with a simple SQL statement. So i'll probably need to use an Arc Toolbox or Python script or something.

Best Answer

You could always do the conversion on the fly by casting the geometry object to a geography object. For example:

SELECT geography::STGeomFromText(SHAPE.ToString(),4326) FROM featureclass;