Hello,
I need to create a query SQL to show all table names and the SRID (EPSG Code) from each table on Enterprise Geodatabase SQL Server.
Currently, I can use this SQL to show the Srid for one table:
SELECT DISTINCT SHAPE.STSrid AS espg_code FROM table_name;
But I need to show Srid for all geometry tables in the database.
I tried some queries but without success.
Solved! Go to Solution.
SELECT l.database_name [DatabaseName],
l.table_name [TableName],
l.owner [SchemaOwner],
sr.auth_srid [SRID],
srtext [WKT]
FROM [database].[dbo].[SDE_layers] l
inner join database.dbo.SDE_spatial_references sr
on l.srid = sr.srid
SELECT l.database_name [DatabaseName],
l.table_name [TableName],
l.owner [SchemaOwner],
sr.auth_srid [SRID],
srtext [WKT]
FROM [database].[dbo].[SDE_layers] l
inner join database.dbo.SDE_spatial_references sr
on l.srid = sr.srid
Tank's @CoffeeforClosers , it works!!!!