Forum Discussion
SSMS Object Explorer doesn't show any of my databases
I'm a very green amateur sysadmin of a SQL Server installation that only I will use. I've gotten myself in trouble, and I hope someone can help me get out of it!
I installed an updated version of SQL Server without understanding how a connection's server name determines which version is used. I ended up with the new version installed, but the old version still executing queries.
I eventually found a clear explanation of how server names work, and I fixed the problem, but I did a lot of thrashing around first, and now I find that none of my databases are visible to any of the defined server names in SSMS's Object Explorer. The databases are still present in the file system, but I can't get at them.
I have never created a user (another concept I initially didn't understand), so every defined server name must be connecting as the default user created by the installer, with role 'sysadmin'. (I have confirmed that the user is a sysadmin with a query.) Sysadmin users are supposed to have access to all databases. I understand that it's not even possible to deny a sysadmin access to a database with REVOKE or DENY, or, I assume, by any similar means.
Given that, how could my databases have disappeared from Object Explorer? How can I get them back?
3 Replies
- MW_DEVBrass Contributor
Hi, let me go through your questions one by one.
1. Is your understanding of the three instances correct?
Yes, exactly. Each SQL Server instance is independent and manages its own databases. Your two databases are currently hosted by SQL Server 2014 (instance #1). Installing SQL Server 2025 as two separate instances (#2 and #3) did not automatically move or copy those databases.
One small clarification: "Database Snapshots" is a folder inside the "Databases" node in Object Explorer. It's perfectly normal for that folder to be empty.
2. Why do your queries always return SQL Server 2014?
Are you absolutely sure you're connecting to SQL Server instances #2 and #3, rather than connecting to instance #1 again? I have a feeling that this is a problem and I suspect there might still be some confusion about how SQL Server instance names work. When you install multiple SQL Server instances on the same computer, each instance has its own name. When connecting through SSMS, you must specify which instance you want to connect to. Especially named instances require the computer name followed by a backslash and the instance name.
For example, imagine your computer is named MYPC and you have three SQL Server instances installed:
instance #1 => SQL Server (MSSQLSERVER) => Server name to enter in SSMS: MYPC
instance #2 => SQL Server (SQL2025) => Server name to enter in SSMS: MYPC\SQL2025
instance #3 => SQL Server (SQL2025_TEST) => Server name to enter in SSMS: MYPC\SQL2025_TEST
Since you're connecting locally, you could also use:
- . or localhost- default instance (#1) (simply dot symbol)
- .\SQL2025 - named instance (#2)
- .\SQL2025_TEST - named instance (#3)
So please open SQL Server Configuration Manager and select SQL Server Services. You should see the SQL Server Database Engine services installed on your computer. Please check their exact names and whether they're running. If not - right click and choose "Start".
Also, while you're in SQL Server Configuration Manager, please check whether the SQL Server Browser service is running. SQL Server Browser helps SSMS discover named instances and determine which TCP ports they're using. If it's stopped, named-instance discovery or connections that rely on it may fail. You should still see all installed SQL Server services in Configuration Manager even when Browser is stopped.
Then open SSMS, select Connect > Database Engine , and enter the corresponding name in the Server name field.
There's also a second possibility worth checking. Even if you've correctly connected to instances #2 and #3 in Object Explorer, an existing Query Editor window may still be connected to instance #1. Connecting to another server in Object Explorer doesn't automatically change the connection of an already open query window. If you look at the status bar at the bottom of your Query Editor window, it shows which server or instance that particular query window is connected to.
3. Can the same databases be attached to two running SQL Server instances?
This is an important question, and there's a distinction worth making. You cannot have two SQL Server instances simultaneously using the exact same MDF/LDF database files. However, you absolutely can have two independent copies of the same database, one running on SQL Server 2014 and another on SQL Server 2025.
For your situation, I would recommend Backup and Restore rather than Detach and Attach. Here's why:
Your original SQL Server 2014 instance is working, and you mentioned that an application depends on it. I wouldn't risk disrupting that environment just yet. Instead, you can:
1. Create a full backup of your database on SQL Server 2014
2. Connect to SQL Server 2025 (instance #2)
3. Restore the backup to that instance, making sure the restored database uses its own file locations
4. Test your queries and application against the restored database
This leaves your original database untouched and gives you a separate copy for testing
SQL Server 2025 supports migrating databases from older SQL Server versions, including SQL Server 2014. However, database compatibility and application compatibility are not necessarily the same thing. Your application may still depend on specific SQL Server features, logins, or other instance-level configuration.
Also, remember that the two copies will be independent. Changes made to one database won't automatically appear in the other.
One more important point: after restoring a database to SQL Server 2025, you cannot simply restore a new backup from that version back to SQL Server 2014. Keep your original environment and backups until you're confident the migration is successful.
4. Can you uninstall unwanted SQL Server instances through Windows Control Panel?
Yes, essentially, but SQL Server uses its own removal wizard. You can start from Windows Settings > Apps > Installed apps, find the appropriate Microsoft SQL Server installation, select Uninstall, and then use SQL Server Setup to remove a specific instance. The important part is selecting the correct instance in the removal wizard. However, I wouldn't uninstall anything until we've confirmed which instances you're actually using and whether your application depends on them.
- MW_DEVBrass Contributor
Hi!
First of all, don't get discouraged! SQL Server can be confusing when you're starting out, especially when you have multiple instances installed on the same machine. We've all been there, and I'm sure one day you'll look back at this and have a good story to tell :)
I suspect one of two things might have happened.
1. You might be connecting to a different SQL Server instance.
Since you mentioned installing a newer SQL Server version and initially connecting to the older one, I'd start by checking how many SQL Server instances you actually have installed.
Open SQL Server Configuration Manager and navigate to SQL Server Services.
CMD -> Run -> SQLServerManager17.msc (for SQL Server 2025). Other version you can check here:https://learn.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-configuration-manager?view=sql-server-ver17
Then you should see entries such as:
- SQL Server (MSSQLSERVER) – the default instance
- SQL Server (YourInstanceName) – another named instance
For example my Configuration Manager, show me only one instance:Check how many SQL Server Database Engine services are listed and whether they're running. Each instance is independent and maintains its own databases. Just because the MDF and LDF files exist somewhere on your disk doesn't mean they're attached to the instance you're currently connected to.
Once you identify your instances, try connecting to each one in SSMS and run:
SELECT SERVERPROPERTY('ServerName') AS ServerName, SERVERPROPERTY('InstanceName') AS InstanceName, SERVERPROPERTY('ProductVersion') AS ProductVersion; SELECT name, state_desc FROM sys.databases;This should help us identify which instance you're connected to and whether your databases are registered there.
2. Could you have accidentally detached your databases?
Since you mentioned trying several things while troubleshooting, do you remember using Tasks > Detach in SSMS or executing `sp_detach_db`? Detaching a database removes it from the SQL Server instance but leaves the MDF and LDF files on disk. That would explain why the database files still exist but the databases are no longer visible in SSMS. If that's what happened, we may be able to attach them again. However, let's confirm the situation before making any more changes.
Microsoft documentation:
https://learn.microsoft.com/sql/relational-databases/databases/database-detach-and-attach-sql-server
One useful SSMS feature for the future: Registered Servers. Since you're working with multiple SQL Server instances, I'd also recommend exploring the Registered Servers feature in SSMS.
You can open it using View > Registered Servers or Ctrl+Alt+G.
It allows you to register your SQL Server instances, give them meaningful names, organize them into groups, and easily connect to the correct instance. For example, you could register your instances as "SQL Server 2022 - Local" and "SQL Server 2025 - Local" to avoid accidentally working on the wrong one.
Documentation:
https://learn.microsoft.com/ssms/register-servers/create-a-new-registered-server-sql-server-management-studio
And a few friendly suggestions:
- Always take a backup before making significant changes to your databases
- Double-check which instance you're connected to before executing administrative commands
- Avoid manually deleting or moving database files while troubleshooting
- Try changing one thing at a time. It's much easier to identify what went wrong that way
For now, I wouldn't uninstall, delete, or recreate anything. Your database files may still be perfectly fine, and we first need to understand what's happened.
And don't give up! Every experienced DBA has a few stories about mistakes made while learning. The difference is that eventually those mistakes become lessons, and sometimes even funny stories we tell other people :)
- DevoutSkepticTin Contributor
Your answer is very helpful, and enabled me to make a lot of progress. I'll describe my new situation.
I clicked the Connect dropdown in SSMS and selected each of the SQL Server instances in turn. SSMS now displays three Object Explorer entries that describe the three server names:
- The original server, installed a few years ago by the installer for an application I use. Product version is 12.0.4237.0 (SQL Server 2014).
- The server I installed at the start of my present adventure. Product version is 17.0.1145 (SQL Server 2025).
- The server I installed immediately after #2, after I ran a query and got SQL Server 2014, making me think that install #2 had failed because I didn't understand how connections work. Also SQL Server 2025.
But I have a problem connecting to the server name of my choice. Here's what I do:
- Select Connect > Database Engines, opening the Connections dialog. Select server #1 in Server Names and click Connect.
- Click in the Query pane, then click Execute.
- SSMS executes the query and displays the result, which says I'm using SQL Server 2014, which is correct.
- Repeat steps 1-3 for server #2, with the same result, which is wrong.
- Repeat steps 1-3 for server #3, with the same result, wrong again.
Somehow the procedure for connecting to a database, as I understand it, is not working.
The Object Explorer entry for server #1 shows both of the dbo databases I defined, and I found that I can USE a database and SELECT data from its tables, AOK. But the two Object Explorer entries for servers #2 and #3 don't show either one. They have a subentry for "Database Snapshots" instead of "Databases," and both are empty.
Based on your explanation, I think that is simply because I defined the databases in a connection to server #1, and servers #2 and #3 each have their own sets of tables, which don't include those two. If that's correct, then it's natural that I have to use ATTACH to attach those database to server #2 or #3.
That leaves me with these questions:
- Is my understanding of my situation, above, correct?
- What am I doing wrong when I try to connect to different SQL Server names, and I always end up with server #1?
- Will it cause any problems to have the same databases attached to two running SQL Servers? (That's a transitional situation. I can uninstall SQL Server 2014 as soon I'm absolutely sure that both tables and the first table's application are fully compatible with SQL Server 2025.)
- According to Google AI, I can uninstall the SQL Server installations I don't need in Windows Control Panel, just like any other application. Is that correct?
Thanks again for your generous help!