Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On the ESRI-L mailing list this morning there was a question about how to see or export all the coded value domains for a geodatabase. The goal is to present the content of the domains in a tabular form, so they're easy to read.

The DomainToTable tool does this easily for a single domain, but when there are many domains it quickly grows tiresome. The best advice I could give was to the batch processing feature, but even that requires knowing or looking up the names of domains individually.

Surely there's a better way?

share|improve this question
Can probably adapt this code (see Chris Snyder's post) to get at what you want:… – blah238 May 25 '12 at 17:59
All of the domains are listed in the "DomainName" field of the GDB_Domains table. You could easily loop over the names and feed them into the DomainToTable geoprocessing tool through simple code. You also need to be careful with SubTypes as each SubType can potentially have it's own domain. – Brent Edwards May 25 '12 at 18:09
@BrentEdwards, where do you see a GDB_Domains table? I opened up a personal-gdb with domains in Access and it isn't there. I did find GDB_Items with a Definition field which appears to contain the domains, but they're buried in XML. – matt wilkie May 25 '12 at 18:24
Are you using ArcGIS 10? GDB_Domains existed only in 9.3 and earlier. See:… – blah238 May 25 '12 at 18:37
thanks for that page @blah238. I didn't know about that (and yes I'm using v10) – matt wilkie May 25 '12 at 18:43
up vote 10 down vote accepted

Here is something I put together that works on the simple gdb's I have on hand. I don't know how it might or might not handle sub-types with multiple domains (see Brent's comment).


python [input geodatabase]

It exports the tables to the same gdb it's getting the domains from. It will fail if the table(s) exist already.

I initially tried to use an output directory and .csv files for the results instead, but kept getting "ERROR 000142: Field name in dBASE table cannot be longer than 10 characters". It seems to always interpret the path as part of the table name (c.f. table = line) {shrug}.

''' Export all coded value domains in a geodatabase to tables in that gdb '''
import os, sys
import arcpy

gdb = sys.argv[0]

desc = arcpy.Describe(gdb)
domains =

for domain in domains:
    print 'Exporting %s CV to table in %s' % (domain, gdb)
    table = os.path.join(gdb, domain)
    arcpy.DomainToTable_management(gdb, domain, table,
        'field','description', '#')

Resources used:

share|improve this answer
I have found that CSV export in geoprocessing is essentially nonexistent, although you can do it interactively through the Export Data dialog in ArcMap. I usually just use the Python csv module. – blah238 May 25 '12 at 19:07
On CSV export, see related question:… – blah238 May 25 '12 at 19:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.