<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python/arcpy check whether a table is registered with Enterprise Geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-arcpy-check-whether-a-table-is-registered/m-p/1498683#M70930</link>
    <description>&lt;P&gt;maybe something like this?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 20:54:56 GMT</pubDate>
    <dc:creator>TonyAlmeida</dc:creator>
    <dc:date>2024-06-27T20:54:56Z</dc:date>
    <item>
      <title>Python/arcpy check whether a table is registered with Enterprise Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-check-whether-a-table-is-registered/m-p/1498493#M70926</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm looking for something like arcpy.management.is_registered(db, tbl) to determine whether a table is registered with a selected Enterprise Geodabase.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference here is the method for registering a table...&lt;/P&gt;&lt;PRE&gt;arcpy.management.RegisterWithGeodatabase(&amp;lt;&amp;gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/register-with-geodatabase.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/register-with-geodatabase.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Tyler&lt;BR /&gt;ArcGIS Pro 3.2&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 18:11:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-check-whether-a-table-is-registered/m-p/1498493#M70926</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-06-27T18:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python/arcpy check whether a table is registered with Enterprise Geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-check-whether-a-table-is-registered/m-p/1498683#M70930</link>
      <description>&lt;P&gt;maybe something like this?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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.")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 20:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-check-whether-a-table-is-registered/m-p/1498683#M70930</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-06-27T20:54:56Z</dc:date>
    </item>
  </channel>
</rss>

