Search code examples
sql-servert-sqlssmsssms-2017

Switch from SQL Server Express to SQL Server Developer edition on the same computer


My computer has at least 3 installations of SQL Server:

  • SQL Server 2017 64 bits for the Express edition. I can connect with SSMS with localhost\SQLEXPRESS. Version is 14.0.1000
  • SQL Server 2017 Developer Edition. I can connect with SSMS with localhost. Version is 14.0.2027.2
  • SQL Server 2016 LocalDB. Don't know how to connect with SSMS. Version is 13.1.4000.0

I have looked inside HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL and found :

  • MSSQLSERVER (which is the default instance name, right ?)
  • SQLEXPRESS which is the Express version

So, the 2016 LocalDB is not used anymore by any application? (including Visual Studio)

In SSMS which command should I use to connect to MSSQLSERVER or SQLEXPRESS?


Solution

  • To connect to your default instance on your local machine, use this as your "server/instance" name:

    .
    (local)
    localhost
    your-machine-name
    your-ip-address
    

    For the default instance, you must NOT specify the MSSQLSERVER "instance" name...

    And if the SQL Server is on another machine, you need to use either that remote machine's machine name (or the IP address) for connecting to it.

    For any other instance, you need to use any of the above, plus you need to add the instance name to it - in your case, for SQL Server Express, it defaults to SQLEXPRESS, so use

    .\SQLEXPRESS
    (local)\SQLEXPRESS
    localhost\SQLEXPRESS
    your-machine-name\SQLEXPRESS
    your-ip-address\SQLEXPRESS
    

    The LocalDB is not handled the same as the other editions - it is not by default started as Windows startup, but it only gets started when your Visual Studio solution is run (and therefore needs to use the LocalDB instance). With the SqlLocalDB utility (see details here ), you can also explicitly start up a LocalDB instance (and shut it down again, too).