How can I find every record that references a particular record?

geoffcox
Giga Guru

We are trying to consolidate our groups (sys_user_group), but often when we deactivate one we find out later that some object in the system was referencing that group.

I'm considering writing a brute force script that will go through the cmdb for every field on every table to see if it is a reference field, and if so if it references the sys_user_table, and if so, if it matches the particular record I care about!

Is there something that already does this?

7 REPLIES 7

Michael Fry1
Kilo Patron

That's basically what I ended up doing, although mine looks a little different.


Hi,

 

This really helps but it searches in all the servicenow tables which does slow the instance down. I have consolidated a group of 10 tables, in which I want this search script to run specifically. How would one go about that ?

Thanks