How to Create a MS SQL Database to Instance Relationship Report

mpuno
Kilo Contributor

Good day Everyone,

I would like to ask for your help. I am making a report for all our MS SQL Instance CIs and all the Databases that it contain. I am looking at the following tables in the CMDB (cmdb_ci_db_instance, cmdb_ci_db_mssql_instance, and cmdb_ci_db_mssql_database) unfortunately, I couldn't see the link between these 3 tables so I can join them.

I hope someone can help me. The purpose of this report is for us to know which MS SQL Database belongs to the instance since we have a lot of databases with similar names (MASTER, MODEL, MSDB, so on).

Thanks and looking forward to positive replies.

-M

1 ACCEPTED SOLUTION

Creating a Database View would be a great way to limit it to just the specific relationships you want to see. I have done this, myself, in our instance. Start with the MS SQL Instance CI class on the left , join that to the cmdb_rel_ci table on parent and then link to the database on the child (assuming, of course, that the relationships have been mapped!).

I did something similar in our org for database instances related to servers:

find_real_file.png

View solution in original post

5 REPLIES 5

JaneS0665783420
Kilo Guru

Try looking at the table cmdb_rel_ci , depending on how your instance of ServiceNow has been configured, this should give the relationships that have been configured between all the various CIs.

Hi Jestone,

Thanks for the feedback. I looked at the table and unfortunately, I don't think it shows a "straightforward" relation for the database.

I am keen at the possibility of creating a view or and ODBC query in order to publish it as a report.

Regards,

-M

 

Creating a Database View would be a great way to limit it to just the specific relationships you want to see. I have done this, myself, in our instance. Start with the MS SQL Instance CI class on the left , join that to the cmdb_rel_ci table on parent and then link to the database on the child (assuming, of course, that the relationships have been mapped!).

I did something similar in our org for database instances related to servers:

find_real_file.png

Thank you Jestone. 🙂