The server principal is not able to access the database under the current security context.
I get this error when trying to connect to my database using SQL Management Studio 2008. "The server principal "username" is not able to access the database "some_database_name" under the current security context. (Microsoft SQL Server, Error: 916)"
This error can be encountered when connecting to either SQL 2005 or SQL 2008 databases using SQL 2008 Management Studio.
As you may notice, the error message indicates a problem connecting to a database that you do not own. This is caused by SQL 2008 Management Studio attempting to query certain system settings that customers do not have access to.
To resolve this issue do the following:
- Open SQL Management Studio 2008
- In Object Explorer, click "Databases"
- Select View -> Object Explorer Details
- Right click the column headers
- Size (MB)
- Database Space Used (KB)
- Index Space Used (KB)
- Space Available (KB)
- Default File Group
- Mail Host
- Right click on Databases and select Refresh