Search

Showing posts with label Error 916. Show all posts
Showing posts with label Error 916. Show all posts

Friday, May 25, 2012

Error 916 : The server principal “username” is not able to access the database “database_name” under the current security context.

I got below error when trying to connect to my database using SQL Server Management Studio 2008. 


The server principal “username” is not able to access the database “database_name” under the current security context. (Microsoft SQL Server, Error: 916)


This error can be encountered when connecting to either SQL Server 2005 or 2008 databases using SQL Server 2008 Management Studio. 
The error itself indicates the problem that connecting to a database that you do not own.


This issue is fixed and already released in SQL Server 2008 SP1. Please install it for the fix.
Please try using the following workaround without installing SQL Server 2008 SP1 and let us know if that helps:

  • Bring Object Explorer Details window by clicking on “View” in the Menu bar –> Select “Object Explorer Details” in menu (or hitting F7)
  • In Object Explorer window click at Databases folder
  • In Object Explorer Details window right-click at the column header and deselect “Collation”
  • Refresh Databases folder in Object Explorer.

If the issue is not solved, uncheck the following items:
-Size (MB)
-Database Space Used (KB)
-Index Space Used (KB)
-Space Available (KB)
-Default File Group
-Mail Host
-Collation


Ref: http://sql.widestuff.com/?p=168

Friday, July 15, 2011

Error 916


I came across a problem when using Microsoft SQL Server Management Studio 2008 to connect and manage a database which is housed on my shared host’s SQL Server 2005, the problem was that I couldn’t actually access my database, as I clicked the “Database” node within “Object Explorer” I received the message:
The server principal “username” is not able to access the database “databasename” under the current security context. (Microsoft SQL Server, Error: 916)
image


















Anyway, after an hour, I decided that I would try and access my database within Microsoft Visual Studio 2008, using the “Server Explorer”. I set myself up with a connection to the database server, and hooray, I could connect and access everything. That left me wondering why it wasn’t working in the Management Studio, so I spent some more time trawling the net for an answer (since I’m hardly a SQL Server guru!). I eventually found something to help me out…
When I clicked on the “Databases” node within SQL Server Management Studio, the software would (in the background) execute an T-SQL query to retrieve a list of databases along with additional information about those databases, one of those pieces of information is collation, which I didn’t have permission to do for every database, only my own.
Fix:
  1. In Object Explorer, click Databases
  2. Display “Object Explorer Details” (F7) or “View –> Object Explorer Details”
  3. Right click the column headers and deselect “collation”
  4. Refresh Databases, and hopefully solved