HOW TO
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 Class, Create 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.
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:
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
Get help from ArcGIS experts
Download the Esri Support App