Skip to main content
Solved

Check for the existence of a Feature Class in SQL Server Enterprise Geodatabase


garbadek
Contributor
Forum|alt.badge.img

I want to pass a feature class name into a workspace and have the workspace tell me if the feature class exists in my SQL enterprise geodatabase. The purpose is if the Feature Class exists I want to backup the existing feature class, then truncate its data and append new data into it. If the Feature Class doesn't exist I want to create it. I've tried the Schema (any format) method with no luck (when you pick ESRI geodatabase SDE if requires you to select the table you want to check against manually and I want to pass in a parameter). I really thought there would just be an "Exists" transformer, but sadly I can't find one. Any suggestions would be greatly appreciated.

Best answer by nielsgerrits

I do not know of a way to do this, other than use the SQLExecutor.

View original
Did this help you find an answer to your question?

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+52
  • VIP
  • Best Answer
  • November 3, 2023

I do not know of a way to do this, other than use the SQLExecutor.


garbadek
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 3, 2023

As a matter of fact that's exactly what I did. Just a quick query on the SDE_Layers table with a count of the table_name(s) that match my parameter. Then just a TestFilter to test for >0. If not "Fail" if so "Pass". Thank you for the quick response. Sometimes I get so wrapped up in using a certain transformer (like Schema (Any Format), that I miss the forest for the trees.... I.E. SDE already provides this answer with a simple query.


nielsgerrits
VIP
Forum|alt.badge.img+52
garbadek wrote:

As a matter of fact that's exactly what I did. Just a quick query on the SDE_Layers table with a count of the table_name(s) that match my parameter. Then just a TestFilter to test for >0. If not "Fail" if so "Pass". Thank you for the quick response. Sometimes I get so wrapped up in using a certain transformer (like Schema (Any Format), that I miss the forest for the trees.... I.E. SDE already provides this answer with a simple query.

Cheers :)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings