• I haven't run the code yet, but, as far as I can tell, you populate table DatabaseSettings with all DBs with dbid > 4, by default enabling all of the options, then you disable the options only for the databases that match WHERE [DBName] IN ('CHANGEME')".

    Personally, I think you should add all of the databases but disable the settings by default (thus "name, 0,0,0,0") , then enable the options for the databases defined in the ChangeMe clause.