find SYS_ID and its Tablename and table's Parent table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 03:39 AM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 03:47 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 03:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 07:25 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 07:31 AM