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

what is the function for getting SRID from Geometry field. I have inserted a shapefile into SQLServer table with Geometry field defined. I know the projection of shapefile is Swreff99_1800 (EPSG:3011). Now my question is How I get this SRID 3011 by using some OGC method of geometry field?

share|improve this question
I'm not clear as to what you are needing. Do you need the definition of the SRID 3011 from SQL Server? It sounds like you have already inserted the data with the proper SRID set, yes? – Chad Cooper Feb 7 '12 at 12:54
up vote 19 down vote accepted

Is this what you are looking for?

select distinct SP_GEOMETRY.STSrid from dbo.MYTABLE

This will give you a table with the different SRID's used in the table dbo.MYTABLE

share|improve this answer
Thanks!. My second question is SRID 3011 is not defined in sys.spatial_reference_systems table. And i need to transform the geometry from SRID 3011 to SRID 4326. What I do then ? – user1899 Feb 7 '12 at 13:41
As far as I know, SQL Server 2008 is not able to transform your geometry data bewteen different coordinate systems - it sees all geometry data as stored in a mathematical coordinate system. – Peter Horsbøll Møller Mar 19 '12 at 20:10

After trying the above with no luck, I tried the method below:

select [geomColumnName].STSrid
from [schema].[tableName]

This gives the SRID value for all records in the table. I would assume that since all records SHOULD have the same SRID, that if you wanted to simply get the value for one record it would tell you the SRID for the entire table:

select top 1 [geomColumnName].STSrid
from [schema].[tableName]
share|improve this answer

I believe the number that you'd want to use at this point would be srid 4619 or srid 4977 is SQL server.

These are both equivalent to EPSG 3011.

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.