Databases with no matching login on server

How can we help?
< All Topics
Print

Databases with no matching login on server

When moving databases between SQL Servers, it might contain logins attached to the database, that does not exist on the new SQL Server.

To query the Performance Store database for databases with no matching logins on servers, use:

select d.server_name, d.database_name
from dbo.database_security d
left join dbo.security s on s.server_name = d.server_name and s.name = d.name
where s.server_name is null
group by d.server_name, d.database_name

The alert will be visible on the Latest stats dashboard.

To exclude specific servers from this alert, see how to use the dbo.team_alert_exclude table in Alerting.

Table of Contents