[GIS] Merge an entire Geodatabase in ESRI ModelBuilder

arcgis-desktopfile-geodatabasemergemodelbuilder

How can I merge an entire Geodatabase in the ESRI (ArcView) ModelBuilder? I have several FeatureClasses created into the GDB and in the model I plan to merge them all. Right now I have imported all the FCs by hand into the Model. This is not the solution I am aiming for because the names and the amount of FCs could vary.

Best Answer

You can accomplish this using this python script, here is the syntax:

import arcpy
from arcpy import env
env.workspace = "C:\\temp\\test.gdb"
fcList = arcpy.ListFeatureClasses('','')
arcpy.Merge_management(fcList, "Merge")

Just change the env workspace to match your geodatabase path.