Skip to main content
How to convert the feature classes stored in SQL Server database to file geodatabase,

 

 

 

I couldn’t figure out the best practice to convert the the feature classes stored in SQL Server database to file geodatabase.

 

 

 

 

 

Thank you

 

 

 

Best

 

 

 

Jamal
Jamal, it's a ... too vague question.

 

 

The answer to the question is:

 

- read features from the SQL Server dataset,

 

- transform them if necessary,

 

- write them into a File Geodatabase dataset.

 

That's all.

 

 

What's the problem you are facing to?
 a writer for each table, dynamic writing or use a fanout....?
Perhaps the source format is ArcSDE?

 

If so, you will have to select ArcSDE as the Format in the Add Reader dialog.
Thank you Takashi and Gio for the help,

 

 

 

My issue here is that I need the conversion to be generic such that the transformer can convert ALL feature classes and tables from the enterprise geodatabase (ArcSDE) to file geodatabase.

 

 

 

At the moment, the “Microsoft SQL server spatial” requires selecting the feature classes and table that will be transferred. Then what if new feature classes or tables are added to the enterprise geodatabase? Do I need to go back to the tool and select them so that these new feature classes and tables can be transfered?

 

 

 

 

 

 

 

 

 

 

 

I have tried also the ESRI ArcSDE but I got the error below.

 

 

 

 

 
Yes,  if u use the reader you must choose the tables.

 

 

 

To read dynamically you could use a SQL-creator.

 

AS you can make your'e sql-script fully paramterised you can create user parameters, choice lists etc.

 

SQL-creator (and executor) allows for much more freedom.

 

 

Of course you then are required to create a sql-script.

 

If there are (materialised)views in the database for instance, you can copy the main sql body to your creator and adapt and parametrise whatever you want to.

 

 

You can even create a sql-creator to query and load the view and have a second creator execute it (witout writin the sql for it...) (there is a thread in this forum a couple months ago on this topic btw)
Thanks Gio,

 

 

 

Does this mean that there is no generic “out of the box” tool in FME that can convert the ArcSDE geodatabase (SQL or Oracle) to file geodatabase? The available tool requires selecting feature classes\\tables. But my aim here is to have a workbench that convert the ArcSDE geodatabase to file geodatabase without selecting feature classes\\tables.

 

 


(revised)

 

A new output port called <Schema> has been added to the FeatureReader in FME 2015.1.

 

With FME 2015.1, this might be possible if you could get table names from the source database.

 

 

(1) Read all table names from the source dataset (I don't know how to do it for ArcSDE dataset).

 

(2) Send the features to a FeatureREader, passing the table name to the "From Attribute" parameter.

 

(3) Merge the schema feature to data features by a FeatureMerger, joining on

 

- Requestor (data feature)  fme_feature_type

 

- Supplier (schema feature)  fme_feature_type_name

 

(4) Send the Merged features to a File Geodatabase writer feature type.

 

Check "Dynamic Properties" and select "Schema from first feature" for the "Schema Sources" parameter.

 


The data flow on the Canvas looks like this.

 


Many thanks Takashi.

 

 

 

It appears that the 2015.1 is still unavailable for download to try the valuable approach you have already recommended.

 

 
FME 2015.1 has been released a few days ago, you can download that here. (http://www.safe.com/support/support-resources/fme-downloads/)
Many thanks Takashi for the massive efforts,

 

 

 

I have tried the dynamic approach with 2015.1 but it fails to read from SQL Server and write in file geodatabase.

 

 

 

 

 

 

 

Could you please drop me the workbench (my e-mail is jamal432@gmail.com) you have shared in one of the previous posts (screenshot is below)

 

 


In the screenshot, I have illustrated required parameter settings for the transformers and the writer, except database connection and SQL statement.

 

Regarding the database connection setting, I cannot provide them since it completely depends on your environment.

 

 

If the source format is "pure" SQL Server database, you can get every table name in the specified database with this SQL statement.

 

-----

 

select name from sys.tables;

 

-----

 

 

But, unfortunately, I don't know the correct SQL statement to get table names within an ArcSDE dataset. The above statement may not work for ArcSDE.

Reply