Hello,I'm looking for something like arcpy.management.is_registered(db, tbl) to determine whether a table is registered with a selected Enterprise Geodabase.
For reference here is the method for registering a table...
arcpy.management.RegisterWithGeodatabase(<>)
https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/register-with-geodatabase.htmAny ideas?
TylerArcGIS Pro 3.2
maybe something like this?
import arcpy # Path to your table within the geodatabase table_path = r"C:\Path\To\Your\Database.sde\TableName" # Check if the table exists if arcpy.Exists(table_path): # Get the workspace (geodatabase connection) workspace = arcpy.Describe(table_path).path # Check if the workspace is an Enterprise Geodatabase if arcpy.Describe(workspace).workspaceFactoryProgID == "esriDataSourcesGDB.SDEWorkspaceFactory.1": # List registered tables in the geodatabase registered_tables = arcpy.ListTables("*", "", workspace) # Check if the table is in the list of registered tables if table_path in [t.dataSource for t in registered_tables]: print("The table is registered with the Enterprise Geodatabase.") else: print("The table is not registered with the Enterprise Geodatabase.") else: print("The workspace is not an Enterprise Geodatabase.") else: print("Table does not exist.")
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.