13

I have created a second database on my existing Azure SQL server. The first database works fine and I can see it using SSMS.

I cannot see the second database in the object explorer. Autocomplete detects that it exists however.

Any suggestions?

Sam
  • 243
  • 3
  • 7

3 Answers3

25

So for me, it turned out that when I was connecting using SSMS, I had set the database to connect to as my first database by accident - meaning that was all I could see.

On connect, go to Options, then check the database you're connecting to. If you're using multiple users to connect to that server like I was, my admin user ended up also being forced to connect to a single database instead of < default >.

Ilessa
  • 366
  • 3
  • 5
  • Ah, that makes sense. I have a few databases I like to be able to connect to quickly. I use the Registered Servers view window and add a New Server Registration for each specific database I need quick access to, specifying the database explicitly in the connection options. – Larry Silverman Apr 03 '17 at 15:18
  • Ding ding ding!!! That was it - been bothering me this whole time :) – Sam Apr 04 '17 at 05:06
  • 1
    Ha thanks, your question turned up when I was having the same problem! Glad I could help :) – Ilessa Apr 04 '17 at 09:06
  • Thanks for your answer, that somehow solved the *urgent* issue I had too. But I recall you could see more than one DB, if your user had the right privileges, within the same connection. Now it seems I'm stuck with the one DB I select in Options tab. Has something changed? – superjos Apr 17 '18 at 09:10
  • If you leave the DB in the options tab to you can see all the databases that user has permission to see. In my case, I had a user who could only see one DB and (as this user came up first in the list) when I changed user to the one with multiple connections, it didn't change the DB in the Options pane. – Ilessa Apr 23 '18 at 10:21
1

SSMS does not automatically update the database list when new databases are added. You need to refresh the view manually.

In Object Explorer, highlight the Databases node. Hit F5 to refresh. The list of databases should refresh and your new database should appear.

Another method would be to disconnect SSMS from the server and reconnect.

Larry Silverman
  • 547
  • 6
  • 12
  • Interesting, I have a similar problem (using SSMS 13.0.16106.4) and I've tried both these methods and still can't see the other two databases - I can see them on the portal though – Ilessa Apr 03 '17 at 11:01
  • that didn't work for me. I had to create a new connection despite refreshing about 5 times. I have the same version as @llessa. interestingly I now have TWO instances of the server in object explorer and the original only has one database and the one I just added has the newly added missing database – Simon Apr 15 '17 at 11:02
  • There's an aspect of SSMS 2016 behavior that I've found odd when connecting to Azure SQL Database. Assuming you have admin-level privileges, if you connect and open a query to the Azure SQL server without specifying a default database, you end up in the master database. You can use the database switcher dropdown once, and only once. After that, the switcher cannot be used. It's as though you were not limited to a single database, but after you make a choice, it limits you. I wonder if what you're experiencing is another side-effect of this. – Larry Silverman Apr 17 '17 at 17:28
0

I solved the problem setting <default> in "Connect to database:", in the Connection Properties tab.