MSSQL Database Discovery Not Discovering All Databases — WMI Performance Counter Limitation<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } .kb-wrapper { font-family: Lato, sans-serif; color: #000000; line-height: 1.7; max-width: 100%; } .kb-wrapper h2 { font-size: 14pt; font-weight: 900; color: #032D42; border-bottom: 2px solid #e8fce4; padding-bottom: 8px; margin-bottom: 12px; margin-top: 20px; } .kb-wrapper p, .kb-wrapper li { font-size: 12pt; margin: 8px 0; } .kb-wrapper ul, .kb-wrapper ol { margin: 12px 0; padding-left: 24px; } .kb-wrapper li { margin: 6px 0; } .kb-wrapper code { background-color: #e6f0f5; color: #032D42; padding: 2px 6px; border-radius: 3px; border: 1px solid #b8cfd8; font-size: 11pt; } .kb-wrapper pre { background-color: #e6f0f5; color: #032D42; padding: 12px; border-radius: 3px; border: 1px solid #b8cfd8; font-size: 11pt; overflow-x: auto; margin: 12px 0; } .kb-wrapper .info-callout { border-left: 4px solid #52B8FF; background-color: #e6f4ff; padding: 12px; margin: 12px 0; border-radius: 2px; } .kb-wrapper .info-callout strong { color: #032D42; } .kb-wrapper table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12pt; } .kb-wrapper table th { background-color: #032D42; color: #FFFFFF; padding: 10px; text-align: left; font-weight: 900; } .kb-wrapper table td { padding: 10px; border-bottom: 1px solid #d0d0d0; } .kb-wrapper table tr:nth-child(even) { background-color: #e8fce4; } .kb-wrapper a { color: #032D42; text-decoration: underline; } .kb-wrapper .related-link-disclaimer { font-size: 10pt; font-style: italic; color: #666666; margin-top: 4px; } Issue ServiceNow Discovery does not discover all MSSQL databases on SQL Server instances with 700+ databases. Databases exist on the SQL Server but do not appear in cmdb_ci_db_mssql_database. Symptoms Discovery returns fewer databases than exist on the SQL Server instance.Databases visible in sys.databases are missing from the Discovery results. Facts The OOB pattern uses this WMI query: SELECT name FROM Win32_PerfFormattedData_MSSQLSERVER_SQLServerDatabases Release All Versions Cause SQL Server has a limited pool of performance counter IDs. On servers with 700+ databases, this pool becomes exhausted, preventing some databases from receiving counter registrations. Unregistered databases do not appear in WMI query results, even though they remain fully functional in sys.databases. This is a Windows/SQL Server limitation, not a ServiceNow defect. Resolution Apply the provided update set, which adds a sqlcmd-based discovery step using Windows authentication to retrieve all databases directly from SQL Server, bypassing the WMI performance counter limitation. Import the update set into a pre-production instance.CSTASK1456446_MSSQL_DB_Active_Directory_creds.xmlTest by running Discovery against a SQL Server instance with 700+ databases.Verify the discovered database count matches SELECT COUNT(*) FROM sys.databases on the SQL Server.If successful, promote to production and run Discovery as normal. Note: The MID Server service account must have read access to the SQL Server instance for this fix to work. This access is typically already configured for Windows-level Discovery. Related Links ServiceNow Discovery PatternsWindows CMDB CI Mapping