find SYS_ID and its Tablename and table's Parent table

ankit_sharma487
Kilo Guru

I have Sys_Id , i want to find whether this is part of DATABASE INSTANCE table or any of its CHILD tables, how can i do this

 

is there some base table where i can find and what is the function name 

4 REPLIES 4

Dubz
Mega Sage

Have look at the below post from Goran Lundqvist, there's a link to an update set on github that has a nice little script to find a sys_id

 

https://community.servicenow.com/community?id=community_blog&sys_id=e46ceaa1dbd0dbc01dcaf3231f96190b

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

 

If this is related to CMDB. THen you can query cmdb_ci table and use CLASS field to find the table name of this sys id.


Thanks,

Ashutosh Munot

Munender Singh
Mega Sage

Hi Ankit,

Please use this code,

var gr = new GlideRecord('sys_db_object');
gr.addQuery('sys_id','8093be76795203006517636e4f534999'); //put your own sysid
gr.query();
while(gr.next())
{
//gs.print('The table is-' +gr.label);

gs.addInfoMessage('The table is-' +gr.label); //table name to which the sysId belongs


}

Regards,

Munender

 

**Kindly hit like/Helpful if found correct

Jim Coyne
Kilo Patron