<?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: How to find every reference to a particular domain in a geodatabase? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340696#M19393</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a tool or script to list all active domains (and field names in each feature where are used) and all unused domains in a workspace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Nov 2014 16:08:11 GMT</pubDate>
    <dc:creator>GastonIzaguirre</dc:creator>
    <dc:date>2014-11-25T16:08:11Z</dc:date>
    <item>
      <title>How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340687#M19384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know how to use python to find every field (and fields on subtypes) that use a particular domain? Our SDE is 10.2 and on an Oracle database, and I have desktop 10.2.1. Basically if I need to change a domain (like change it's data type from string to integer) I need to delete it and recreate it.&amp;nbsp; In order to delete it I need to find every place it's used and un-reference it. This is hard to do in a large SDE where domains are shared between many fields and feature classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The out of the box method seems to be looping through EVERY feature class(and subtype) on the database and running arcpy.describe on every field see if they use a particular domain.&amp;nbsp; This seems extremely inefficient and will take forever on our large SDE.&amp;nbsp; Surely there must be a better way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured querying the SDE administration tables would be quicker but ran into some walls.&amp;nbsp; By querying the GDB_Items and GDB_ItemRelationship tables I was able to see what feature classes reference a domain, but these don't seem to tell you which field(s) are using the domain, nor does it seems to show if a particular subtype uses a domain.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was curious how SDE at 10.2 actually stores that a field is using domain x, and also how it tracks that subtype y uses domain x.&amp;nbsp; This way I can query the administration tables directly to make this process much faster.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I plan to use the proper toolbox tools to make the domain assignment changes, I just want to query the administrative tables to find the references and quickly as possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for any help you can provide,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 14:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340687#M19384</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2014-03-12T14:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340688#M19385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you give this SQL script a try in your Oracle database (run as SDE, SYSTEM, OR SYS user)?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]32159[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script, when run in a 10.1 or higher Oracle geodatabase, should return all domains as well as which feature classes to which they are associated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if it works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 20:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340688#M19385</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2014-03-12T20:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340689#M19386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the code.&amp;nbsp; It does run, but it doesn't provide the name of the field the domain is used for, or the field on a subtype within a feature class that uses a domain.&amp;nbsp; This does help though since it reduces the number of feature classes I would have to loop through.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 20:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340689#M19386</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2014-03-12T20:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340690#M19387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm sure there's a Python solution that would be more complete in terms of the detail you originally asked to have.&amp;nbsp; I couldn't find any way to link the domain to a field within the ArcSDE system tables at 10.1 or higher.&amp;nbsp; Glad to hear this is somewhat helpful, though.&amp;nbsp; I'll see what I can dig up in terms of Python scripting.&amp;nbsp; Lastly, it would be nice if you could vote up helpful posts when people assist you in the forums.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 20:32:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340690#M19387</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2014-03-12T20:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340691#M19388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the python extension &lt;/SPAN&gt;&lt;A href="http://cx-oracle.sourceforge.net/" rel="nofollow noopener noreferrer" target="_blank"&gt;cx_Oracle&lt;/A&gt;&lt;SPAN&gt; to run a SQL query to find which feature classes have a domain applied.&amp;nbsp; You can then loop through each feature class and find which fields have a domain applied.&amp;nbsp; Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import cx_Oracle, arcpy
from arcpy import env

connstr = 'sde/sde@orcl'
conn = cx_Oracle.connect(connstr)
curs = conn.cursor()

list = []

#find feature classes that contain a domain and append to list
curs.execute("select UUID from sde.gdb_items where type = '{8C368B12-A12E-4C7E-9638-C9C64E69E98F}'")
for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp; curs2 = conn.cursor()
&amp;nbsp;&amp;nbsp;&amp;nbsp; curs2.execute("select ORIGINID from SDE.gdb_itemrelationships where DESTID = '" + row[0] + "'")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row2 in curs2:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs3 = conn.cursor()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs3.execute("select NAME from sde.gdb_items where UUID = '" + row2[0] + "'")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row3 in curs3:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row3[0])

conn.close()

#remove duplicates from list
list = dict.fromkeys(list)
list = list.keys()

env.workspace = r"Database Connections\VECTOR@ORCL.sde"

#loop through fields to find which has a domain
for fc in list:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in arcpy.ListFields(fc):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if field.domain:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc, field.name&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:06:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340691#M19388</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T16:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340692#M19389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the GIS Diagrammer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://kiwigis.blogspot.com/2010/07/arcgis-diagrammer-for-arcgis-10.html"&gt;http://kiwigis.blogspot.com/2010/07/arcgis-diagrammer-for-arcgis-10.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Does anyone know how to use python to find every field (and fields on subtypes) that use a particular domain? Our SDE is 10.2 and on an Oracle database, and I have desktop 10.2.1. Basically if I need to change a domain (like change it's data type from string to integer) I need to delete it and recreate it.&amp;nbsp; In order to delete it I need to find every place it's used and un-reference it. This is hard to do in a large SDE where domains are shared between many fields and feature classes.&lt;BR /&gt;&lt;BR /&gt;The out of the box method seems to be looping through EVERY feature class(and subtype) on the database and running arcpy.describe on every field see if they use a particular domain.&amp;nbsp; This seems extremely inefficient and will take forever on our large SDE.&amp;nbsp; Surely there must be a better way.&lt;BR /&gt;&lt;BR /&gt;I figured querying the SDE administration tables would be quicker but ran into some walls.&amp;nbsp; By querying the GDB_Items and GDB_ItemRelationship tables I was able to see what feature classes reference a domain, but these don't seem to tell you which field(s) are using the domain, nor does it seems to show if a particular subtype uses a domain.&lt;BR /&gt;&lt;BR /&gt;I was curious how SDE at 10.2 actually stores that a field is using domain x, and also how it tracks that subtype y uses domain x.&amp;nbsp; This way I can query the administration tables directly to make this process much faster.&lt;BR /&gt;&lt;BR /&gt;I plan to use the proper toolbox tools to make the domain assignment changes, I just want to query the administrative tables to find the references and quickly as possible.&lt;BR /&gt;&lt;BR /&gt;Thank you for any help you can provide,&lt;BR /&gt;&lt;BR /&gt;Andrew&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 12:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340692#M19389</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2014-03-13T12:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340693#M19390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Exploring this made me curious how ESRI actually stores what fields use domains.&amp;nbsp; I guess its stored in some XML blob somewhere now at 10.1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 13:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340693#M19390</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2014-03-13T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340694#M19391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for the code JSkinn3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used the arcpy.ArcSDESQLExecute command in the past to return sql results.&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/#/ArcSDESQLExecute/018z0000007z000000/"&gt;http://resources.arcgis.com/en/help/main/10.2/#/ArcSDESQLExecute/018z0000007z000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have to check out that extension since sometimes managing how arcpy returns records can be squirrely.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 13:59:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340694#M19391</guid>
      <dc:creator>AndrewRudin</dc:creator>
      <dc:date>2014-03-13T13:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340695#M19392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To go the unorthodox route.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can export the XML Schema of a geodatabase.&amp;nbsp; Do Schema only NOT data.&amp;nbsp; gets large that way&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Open that XML in Excel.&amp;nbsp; copy and paste it to notepad.&amp;nbsp; copy and paste it back into excel.&amp;nbsp; Some fields will be hidden under the moniker *metadata when you open it in excel.&amp;nbsp; putting it in notepad removes it and makes it visible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now import that excel file into Access and now assess the imported table.&amp;nbsp; There should be a column called DomainName and that will contain all your Domains.&amp;nbsp; Most of the entries will be blank.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every feature class will be shown in this table and when I tested it out there was a column called DomainName48 that contained the the name of a domain and the name of the feature in a another column and the name of the attribute it was assigned to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, when I tested this out I did it on a database that had a number of Subtyped features.&amp;nbsp; It will show you every instance of every Subtype of that feature that uses that domain.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Conversely you can use the file in Excel itself when you past it back in and using the Filter you can filter it to show a single domain name and then it will show you all the features (and subtypes) with that domain&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It isn't pretty but it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Exploring this made me curious how ESRI actually stores what fields use domains.&amp;nbsp; I guess its stored in some XML blob somewhere now at 10.1.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 14:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340695#M19392</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2014-03-13T14:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340696#M19393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a tool or script to list all active domains (and field names in each feature where are used) and all unused domains in a workspace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 16:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340696#M19393</guid>
      <dc:creator>GastonIzaguirre</dc:creator>
      <dc:date>2014-11-25T16:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340697#M19394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used this in the past:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; import os

&amp;nbsp;&amp;nbsp;&amp;nbsp; # output file (change this)
&amp;nbsp;&amp;nbsp;&amp;nbsp; report = r"D:\Xander\Domains\list_unused_domains.txt"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # database connection (change this)
&amp;nbsp;&amp;nbsp;&amp;nbsp; conn = r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Dev 10.2.sde"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # set encoding to utf-8 (for non ASCII chars)
&amp;nbsp;&amp;nbsp;&amp;nbsp; import sys
&amp;nbsp;&amp;nbsp;&amp;nbsp; reload(sys)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print sys.getdefaultencoding()
&amp;nbsp;&amp;nbsp;&amp;nbsp; def_enc = sys.getdefaultencoding()
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.setdefaultencoding('utf8')

&amp;nbsp;&amp;nbsp;&amp;nbsp; with open(report, "w") as f:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write("Domains not in use\n")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create list of domains
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; domains = arcpy.da.ListDomains(conn)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_names = [domain.name for domain in domains]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # list featureclasses
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = conn
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_fds = arcpy.ListDatasets(feature_type="feature")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_fds.append("")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_doms = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fds in lst_fds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_fc = arcpy.ListFeatureClasses(feature_dataset=fds)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in lst_fc:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = arcpy.ListFields(os.path.join(ws, fds, fc))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fld.domain != "":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_doms.append(fld.domain)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # process tables
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_tbl = arcpy.ListTables()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for tbl in lst_tbl:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = arcpy.ListFields(tbl)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fld.domain != "":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_doms.append(fld.domain)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create list of domains not in use
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_notinuse = list(set(lst_names) - set(lst_doms))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # write to file
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for dom in lst_notinuse:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write("{0}\n".format(dom))

&amp;nbsp;&amp;nbsp;&amp;nbsp; # restore default settings
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.setdefaultencoding(def_enc)


if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does not get you the full list of domains that are in use. It is possible (and I have seen cases) where a column used with a default value in a subtype uses domain 'a' while the field itself uses domain 'b'. So if you have subtypes, you should check the domains in use by the subtypes too Use arcpy.da.ListSubtypes(featureclass).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:06:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340697#M19394</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T16:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340698#M19395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your answer and for sharing your script code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I'm using ArcGIS version 10, which does not contains the arcpy.da module, so I will try to adapt the script to make it compatible, some kind of backport, if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Gaston.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 15:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340698#M19395</guid>
      <dc:creator>GastonIzaguirre</dc:creator>
      <dc:date>2014-11-28T15:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every reference to a particular domain in a geodatabase?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340699#M19396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid there is not much support for listing domains without the data access (da) module. You may have to use one of the other suggestions (like the one by Jake) directly on the database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 15:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-find-every-reference-to-a-particular-domain/m-p/340699#M19396</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-11-28T15:18:40Z</dc:date>
    </item>
  </channel>
</rss>

