High severityconnection
Power BI Refresh Error:
4060
What does this error mean?
The requested database does not exist, is offline, or the login has no access to it.
Common causes
- 1The database name in the connection string is misspelled or does not exist
- 2The database is offline or in single-user mode
- 3The login has no user mapping in the target database
How to fix it
- 1Step 1: Verify the database exists and is online: SELECT name, state_desc FROM sys.databases WHERE name = 'targetdb';
- 2Step 2: Bring the database online if it is offline: ALTER DATABASE [targetdb] SET ONLINE;
- 3Step 3: Create a user for the login if missing: USE [targetdb]; CREATE USER [loginname] FOR LOGIN [loginname]; GRANT SELECT ON SCHEMA::dbo TO [loginname];
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-4060-database-engine-error