I haven't tried this, and there are serious problems with it (see below), but...
Using your SQL management software for whichever database platform you run, create an INSERT/DELETE/UPDATE trigger on the database table that you want to use as your domain source. The new trigger should include an SQL command to execute an external Python script (AFTER the insert/delete/update).
The Python script can then run the arcpy.TableToDomain()
tool to update the domain automatically every time the table is updated.
It's messy (I dislike the obscurity of triggers in general), plus...
Of course arcpy.TableToDomain()
is likely to fail if anybody has a lock on the database schema (which is going to be likely any time somebody is updating that table!), so in reality this is not practical. You could work around this by forcefully disconnecting all users before running the arcpy.TableToDomain()
, but of course that is very disruptive and could result in lost work. So again, not practical.
So the next best option would be to run the script on a nightly schedule at a time when users are unlikely to be connected, instead of being run by a database trigger. This is how I've done it in the past, but it means that your domain is up to 24 hours behind the current table values.