Why This Error Happens
This error occurs because the CREATE DATABASE permission is a server-scoped (or more precisely, master-database-scoped) permission in SQL Server, and it cannot be granted while your query execution context is pointed at a user database. SQL Server 2025 strictly enforces this legacy T-SQL rule inherited from earlier versions, meaning the GRANT CREATE DATABASE TO [user] statement will fail with Error 4619 if the active database in your session (shown in the SSMS dropdown or via USE statement) is anything other than master. This is almost always a context/scope issue rather than a true permissions or corruption problem.
Step-by-Step Resolution Guide
Step 1: Verify Your Current Database Context
- Open SQL Server Management Studio (SSMS) and check the database dropdown in the toolbar; it should read
master. - Alternatively, run the following query to confirm your active context:
SELECT DB_NAME() AS CurrentDatabase;
- If the result is not
master, this confirms the root cause of Error 4619.
Step 2: Switch Context to the Master Database
- Explicitly switch your session context using the
USEstatement before running the grant:
USE master;
GO
- In SSMS, you can also simply select
masterfrom the database dropdown list in the toolbar instead of typing the command.
Step 3: Re-Run the GRANT Statement
- With the context now set to
master, execute the permission grant again:
GRANT CREATE DATABASE TO [YourLoginOrUserName];
GO
- Ensure
[YourLoginOrUserName]is a valid login mapped to a user in themasterdatabase, as this permission only applies at that scope.
Step 4: Confirm the Account Has a Valid Master User Mapping
- Navigate to SSMS > Security > Logins > [Your Login] > Properties > User Mapping.
- Ensure the checkbox next to the
masterdatabase is checked for this login; if it is missing, the grant will fail even if the context is correct.
Alternative or Verification Steps
- Verify the Fix: Log in with the target account and attempt to run
CREATE DATABASE TestDB;. If the command succeeds without throwing Error 4619, the permission has been applied correctly. - Alternative Method: If the T-SQL command continues to fail, use the SSMS GUI instead: right-click the Login under Security > Logins, go to Securables, search for the server object, and manually check the Grant box next to
Create any databasein the permissions list.