Skip to main content
Question

Extract Schema and Table Names

  • February 4, 2026
  • 1 reply
  • 29 views

vxn43
Supporter
Forum|alt.badge.img+18

I have a SQL Server Database that has 156 tables. 

I need to extract the schema for each table and table names into a CSV.

 

I know one way is to add all 156 tables to the workbench as separate Readers and then use FeatureReader (with Features to Read set to Schema Features). This could be a start, but it seems rather tedious. 

 

Is there a better way? I want to write to a CSV that has the attributes in one column and the table names in another column. 

 

Any thoughts on the best way to tackle this?

1 reply

_jacques_
Enthusiast
Forum|alt.badge.img+19
  • Enthusiast
  • February 4, 2026

Good morning!

You could use a DatabaseQuerier (or SQLExecutor) and select the table names from the  INFORMATION_SCHEMA.TABLES view. Then use the result from that in a FeatureReader to read the schema of every table. 

SELECT TABLE_NAME, TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES

You can add any specific filters in the SQL query as a WHERE clause or in the FME workbench using Tester/AttributeFilter transformers. 

Then in the FeatureReader you want to set Feature Types to Read as 

@Value(TABLE_SCHEMA).@Value(TABLE_NAME)