I have a big problem with some garbage on system tables. (Ex: suids which doesnt mach with uid from syslogins).
I would like to know if someone was already develop a few querys to detect with rows on system tables are garbage.
Normaly my garbage problems are between sysroles /sysusers/ sysprotects from each database by it will be good to detect automatly by some querys perform to each database.
Any ideas will be welcome ?? or someone had the same problem in the past ???
If u r using proper sps like sp_dropuser,sp_droplogin etc .... then no such garbage condition will rise. for example if u try to drop a login, which have a user in some database, using sp_droplogin it will prompt a massage to drop the user first from any of the databases as following
User exists or is an alias or is a database owner in at least one database. Drop
the user or the alias, or change the database ownership before dropping the
So such situation does not happen unless you are modifying system tables manually which is definately not recommemded.