metricsign
Start free
Medium severitypermission

Power BI Refresh Error:
916

What does this error mean?

The login can connect to SQL Server but does not have a corresponding user in the target database.

Common causes

  • 1The login exists at the server level but no user was created in the target database
  • 2The database was restored from a backup and login-user mappings were broken (orphaned users)
  • 3The login was granted server-level rights but not mapped to a specific database

How to fix it

  1. 1Step 1: Create a database user for the login: USE [targetdb]; CREATE USER [username] FOR LOGIN [loginname];
  2. 2Step 2: For orphaned users after a restore, fix with: USE [targetdb]; ALTER USER [username] WITH LOGIN = [loginname];
  3. 3Step 3: Grant necessary permissions: GRANT SELECT ON SCHEMA::dbo TO [username];

Frequently asked questions

How do I list orphaned users in a database?

Run: USE [targetdb]; EXEC sp_change_users_login 'Report'; — this shows all orphaned database users with no matching server login.

Why does 916 happen after a database restore?

Restoring a database brings the user accounts from the backup but the SIDs may not match the logins on the new server. Use ALTER USER WITH LOGIN to re-map them.

Can the guest account be used as a workaround?

Enabling the guest account (GRANT CONNECT TO guest) allows any login to access the database, but this is a security risk and not recommended for production.

Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-916-database-engine-error

Other permission errors