HOW TO

Register data with the Enterprise Geodatabase in bulk using a Python script

Last Published: June 16, 2025

Summary

Registering a dataset with the geodatabase is used for data created in the database with third-party tools using SQL, or in ArcGIS Pro with tools that do not register with the geodatabase. See the documentation to: Create Unregistered Feature ClassCreate Unregistered Table, and Create Database View tools.

Only limited functionality is available from ArcGIS clients and services for data that is not registered with the geodatabase. Registration stores information about the items—such as table and column names, spatial extent, and geometry type—in the geodatabase's system tables. This allows the registered items to participate in geodatabase functionality.

Users may have several datasets in an enterprise geodatabase to register with the geodatabase. This can be done using the Register With Geodatabase geoprocessing tool: Register With Geodatabase (Data Management)

In cases where users have many different datasets to register with the geodatabase, the process can be automated using a Python script.

Procedure

The following sample Python script can be used to register datasets in bulk with the enterprise geodatabase. Before running the script, set the following variables:

  • Modify the workspace variable in the script to the location of your enterprise geodatabase connection file. 
  • Modify the excludeList variable in the script with the list of feature classes in the enterprise geodatabase to exclude from the script.
import arcpy

# Set the workspace connection to the geodatabase
workspace = r"C:\Temp\sde111.sde"
excludeList = 'TESTFC'

arcpy.env.workspace = workspace OIDField = "OBJECTID"
ShapeField = "Shape" def remove_items_from_list(list1, list2):
    return [x for x in list1 if x not in list2] dsList = []
for fds in arcpy.ListDatasets('', 'feature'):
    dsList.append(fds) for fc in arcpy.ListFeatureClasses():
    dsList.append(fc)
    
for t in arcpy.ListTables():
    dsList.append(t) dsFinalList = remove_items_from_list(dsList, excludeList) for ds in dsFinalList:
    desc = arcpy.Describe(ds)
    print(desc.name)
    if not hasattr(desc, 'isArchived'):
        if desc.canVersion == False:
            if desc.isVersioned == False:
                if desc.datasetType == 'FeatureClass':
                    if desc.shapeType != 'Any':
                        arcpy.management.RegisterWithGeodatabase(ds, OIDField, ShapeField, desc.shapeType, desc.SpatialReference)
                        print('Regisered {0} with the geodatabase'.format(ds))
                if desc.datasetType == 'Table':
                    arcpy.management.RegisterWithGeodatabase(ds, OIDField)
                    print('Regisered {0} with the geodatabase'.format(ds))

Article ID: 000033963

Software:
  • ArcGIS Enterprise

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options