Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SQL Server takes an SRID when creating spatial data, but is it possible to retrieve an object as a different spheroid?

For example, let's say I have a bunch of spatial polygons using SRID 4258, but I'd like to use alongside some pre-existing data that has an SRID of 4326 -- are there built in conversions, or do I have to handle this conversion myself?

share|improve this question
up vote 12 down vote accepted


Transform - ability to transform from one spatial ref to another: No - need 3rd-party tools, Geometry can use any SRID between 0 and 999999. Spatial Tools free CLR add-on does provide limited transform support.


share|improve this answer

Not by default, but check the SQL Server Spatial Tools developed by MSDN on CodePlex. Specifically, the affine transformation functions.

share|improve this answer
+1 I find these tools to be an essential part of Sql Server. – Kirk Kuykendall Oct 20 '10 at 13:23

Example for reprojection from EPSG:2193 to EPSG:3857

c:\OSGeo4W64\bin\ogr2ogr.exe ^
 -f "MSSQLSpatial"^
 -sql "SELECT [Id], [Shape].STAsText() Shape FROM [SourceDbName].[dbo].[SourceTableName]"^
 -nln "DestTableName"^
 -s_srs EPSG:2193^
 -t_srs EPSG:3857

After this execute SQL Query

update  [DestDbName].[dbo].[DestTableName]
set     [ogr_geometry] =  geometry::STGeomFromText([shape], 3857)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.