SQL Server - 2008/2012 - Not able to view list of databases in SSMS - Error 916 - not able to access database under current security context

Last month, a user comes up to me with a very unusual problem. He was not able to see list of databases under the "Databases" group\folder when connecting to a remote SQL Instance using SSMS (SQL Server Management Studios).
He was getting the below error:










Now, before coming up to the solution let me have some pointers about this issue or case as error message "not able to access database 'xyz' under the current security context" can occur due to several reasons, but we are intend to discuss only one particular case in this post.

The pointers are as follows:
  1. Login is part of "public" server role and also had adequate access to the database, which user wanted to use. Also, no granular level deny was applied to the login.
  2. Though the login didn't had any explicit permissions to the database for which the error was thrown but the user was also not intended to use the database.
  3. Considering above points and under default settings user should be able to view the list of the databases.
Apart from the above points one very important point to note here is that user was accessing a SQL 2012 instance using SQL 2008 SSMS, which didn't had any Service Pack installed and this is what causing the error here as well. Though this can be corrected by installing appropriate service pack but there is also a work-around available which you can use to overcome this situation cause and good thing is that this step can be implemented very quickly and also doesn't require any special privileges unlike installing service pack which is both time consuming and will require a person with elevated permission to install it on user's machine.
What all you have to do is go to "Object Explorer Details" tab on the right hand side of the SSMS (Use "F7" in case you're not seeing it) after selecting "Databases" folder in "Object Explorer". On the "Object Explorer Details" you'll see various tabs like "Name", "Policy Health State" etc. Right click on column area and go to select columns and from there uncheck "Collation" option (also uncheck "Compatibility Level" if error persists). Once unchecked hit "F5" and for most of you the error is gone and you're now able to get the database list and work normally.








If in case it didn't worked then we have no options left other than applying the service pack or use the same version SSMS, however for me it worked each time and hope it does for you too.

Comments

Popular posts from this blog

SQL Server: SQL Server services not starting. TDSSNIClient initialization failed with error 0x139f, status code 0x80. Reason: Unable to initialize SSL support.

SQL Server 2014 SP\CU installation getting stuck at “MsiTimingAction”

SQL Server: Cluster Installation failed with error “Wait on the Database Engine recovery handle failed.”