AnsweredAssumed Answered

Script to Discover Domains Misses Some... why?

Question asked by MLF on Jun 25, 2012
Latest reply on Jun 26, 2012 by MLF
Hello! This script appears to work beautifully, but I have discovered that it misses a handful of Feature Classes.  I can't figure out why:

# Marianne F# 06/19/2012 # Discover Domains Applied to SDE Tables & Feature Classes # Using the SDE User Account # It's hard-coded to my DB connection name; I'd like to # change that someday, but not sure yet how to do that. # I will also address the three skipped tables below; # SDE says they don't exist.   import arcpy, os #Set workspace environment to geodatabase arcpy.env.workspace = r"Database Connections\PROD_FAKEsrv1.SDE.sde"  #Get list of feature classes in geodatabase FCs = arcpy.ListFeatureClasses()  #Loop through feature classes in list for FC in FCs:          #List fields in feature class         fields = arcpy.ListFields(FC)          #Loop through fields         for field in fields:              #Check if field has domain             if field.domain != "":                  #Print feature class, field, domain name                 print FC, ",",, ",", field.domain                  #Get list of tables in geodatabase TBs = arcpy.ListTables()  #Get list of tables in geodatabase TBs = arcpy.ListTables()  #Loop through tables in list for TB in TBs:                  if TB == "DBASERVICE.TOAD_PLAN_TABLE":                       continue                  if TB == "TSMSYS.SRS$":                       continue                                      if TB == "NDOT.VW_CDS":                       continue                                  #List tables in feature dataset                 fields = arcpy.ListFields(TB)                  #Loop through fields                 for field in fields:                               #Check if field has domain                     #if != doesn't work try <>                     if field.domain <> "":                      #Print table, field, domain name                         print TB, ",",, ",", field.domain 

This successfully returns many feature classes and the fields to which domains are applied, but misses a handful. I can't find anything the missed feature classes have in common: some are feature classes, some participate in feature datasets.  What am I doing wrong?
Thank you!