916: The server principal is not able to access the database under the current security context
SQL ServerWhat does it mean?
A login attempted to access a specific database but has no access to it under the current security context. The login can connect to the server but has no corresponding user/permission in the target database.
Why does it happen?
The login has no mapped user in the database (orphaned or never created), database access is restricted, or the guest account is disabled. A common case is SSMS Object Explorer trying to read metadata of a database the login has no access to.
How to fix it
Create a user for the login in the target database and grant the required permissions: USE [db]; CREATE USER [login] FOR LOGIN [login]; and assign the appropriate roles/permissions. If an orphaned user exists, map it with ALTER USER ... WITH LOGIN = ... If access is genuinely needed, add it to the appropriate database role; if not, the error is expected behavior (no access to that database).