select dbsname,count(*) from systabnames where dbsname in ( select name from sysdatabases where name not in ("sysmaster","sysuser","sysutils","sysadmin")) and partnum not in (select partnum from sysptnkey) and tabname not in ("systables","syscolumns","sysindices","systabauth", "syscolauth","sysviews","sysusers","sysdepend", "syssynonyms","syssyntable","sysconstraints","sysreferences", "syschecks","sysdefaults","syscoldepend","sysprocedures", "sysprocbody","sysprocplan","sysprocauth","sysblobs", "sysopclstr","systriggers","systrigbody","sysdistrib", "sysfragments","sysobjstate","sysviolations","sysfragauth", "sysroleauth","sysxtdtypes","sysattrtypes","sysxtddesc", "sysinherits","syscolattribs","syslogmap","syscasts", "sysxtdtypeauth","sysroutinelangs","syslangauth","sysams", "systabamdata","sysopclasses","syserrors","systraceclasses", "systracemsgs","sysaggregates","syssequences","sysdirectives", "sysxasourcetypes","sysxadatasources","sysseclabelcomponents", "sysseclabelcomponentelements","syssecpolicies","syssecpolicycomponents", "syssecpolicyexemptions","sysseclabels","sysseclabelnames", "sysseclabelauth","syssurrogateauth","sysproccolumns", "sysdomains","sysindexes","TBLSpace") group by 1;