Home Dashboard Directory Help
Search

Cannot Connect to Default Database by Henri Hein


Status: 

Closed
 as Fixed Help for as Fixed


3
1
Sign in
to vote
Type: Bug
ID: 387121
Opened: 12/8/2008 6:47:51 PM
Access Restriction: Public
2
Workaround(s)
view
1
User(s) can reproduce this bug

Description

In SQL Server 2008 Management Studio, follow these steps:
Connect to a database server with multiple databases with different permissions.
Use SQL Server authentication. (I don't know if it reproduces with Windows native authentication).
Speficy the correct credentials for at least one of the databases, where at least one of the databases is not accessible by those credentials.
Specify the default database to connect to.

After connecting, in Object Explorer, expand the 'Databases' tree.

Observe:

An error like this:

"TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Server user 'myuser' is not a valid user in database 'otherdb'. (Microsoft SQL Server, Error: 916)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=08.00.2039&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476"

Expect:
To be able to connect to the database I listed as default, to which I have permissions.

Note:
This worked in SQL Server 2005.
Details
Sign in to post a comment.
Posted by Atul Dhiman on 1/17/2012 at 10:04 PM
I am having some problem of not opening database in SQL 2008 management studio. It is saying "FAILED TO RETRIEVE DATA FOR THIS REQUEST".
And error no - 916.
Posted by Atul Dhiman on 1/17/2012 at 10:03 PM
I am having some problem of not opening database in SQL 2008 management studio. It is saying "FAILED TO RETRIEVE DATA FOR THIS REQUEST".
Posted by Microsoft on 6/2/2011 at 3:48 AM
Hi

We took a look at this bug along with several others recently. We are already tracking this issue through another connect bug (ID: 354291). Hence closing this bug as a duplicate.

Thanks for writing in to Microsoft.

Cheers,
Sreekar
Posted by Henri Hein on 1/27/2009 at 3:22 PM
Great, thanks Bill! That worked.
Posted by Microsoft on 1/23/2009 at 12:22 PM
Hi Hank,
    It looks like we have a workaround. As the database owner connection, click on the Databases node in OE and then press F7 to call up the Ojbect Explorer Details window. You'll get the nasty error indicating not enough permissions that you can ignore. For each column header in the Details list with the exception of name, right click on the column and deselect it from the list. When you are left with Name, press Refresh for the Databases folder in OE and you should see the complete list of databases. You can then navigate to the specific database that the user owns and perform SSMS operations against that database.
Thank you,
Bill Ramos
Posted by Microsoft on 1/2/2009 at 10:19 AM
Hi Hank,
Thank you for your feedback regarding using a low priveledged user account with SSMS. It terns out with 2008, you don't even have to include the default db specification to have the problem. When SSMS enumerates the DBs, it makes a query for meta-data using the low priv id. If the user account doens't have any permissions to any other DB, the error occurs. There is no workaround for the low priv user - eventhough they own a database they should be able to work with. We will look into this for a future update to 2008.
Thank you,
Bill Ramos
Sign in to post a workaround.
Posted by Peter Edenharter on 3/5/2009 at 3:52 AM
YES and NO ?!
I have 2 PC's with are nearly identical both with XP (latest SP and Hotfixes) and SQL Server Management Studio 2008 (with CU3, Build 1787).

On PC1 I can confirm the problem and solution by selecting / deselecting the collation from the object explorer details.

On PC2 everything works fine, even with the collation selected. It just shows a blank collation entry, when the permissions are not sufficient. No error messages appears.

The only difference is, PC1 has SQL Server Management Studio 2005 and 2008 installed. PC2 has only SQL Server Management Studio 2008. Can this cause a different behaviour with the collation column in object explorer details if the user has limited permissions?
Posted by Simon Sabin on 1/2/2009 at 2:16 PM
Thats an issue with having the collation in the database details grid in the object details pane. Remove collation from the columns and it should work