snippetsqlMinor
How to create a server instance of just ComputerName instead of ComputerName\SQLEXPRESS
Viewed 0 times
createjustcomputernamesqlexpressinstanceinsteadhowserver
Problem
I'm currently hosting a database on the server
I want to move the database to another computer, so I installed SQL Server Express 2014 on it but that computer only has the instance
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
However, I can't enable remote connections on
I don't remember what I did on the previous computer to allow me to connect both to
MyComputerName using SQL Server Express 2014.I want to move the database to another computer, so I installed SQL Server Express 2014 on it but that computer only has the instance
ThatComputerName\SQLEXPRESS. When I try to connect to just ThatComputerName it throws the error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
However, I can't enable remote connections on
ThatComputerName because I can't even connect to that instance.I don't remember what I did on the previous computer to allow me to connect both to
MyComputerName and MyComputerName\SQLEXPRESS, how can I create that instance on the new computer? Do I have to reinstall?Solution
You cannot change the Instance Name after it has been installed. But you can uninstall that SQL Server instance and reinstall as a DEFAULT instance. Ideally you should make a backup of the server, then restore the backups to the new server.
You can technically detach databases and attach again after the reinstall, but that includes the risk of losing your detached databases. See Aaron Bertrand's post:
https://blogs.sentryone.com/aaronbertrand/bad-habits-file-backups/
When installing a default instance of SQL Server Express at the Instance Configuration page, you must choose the Named Instance radio button and type in the default instance name of MSSQLSERVER.
All default instances use the MSSQLSERVER internally, but they just do not make it visible to you.
You can technically detach databases and attach again after the reinstall, but that includes the risk of losing your detached databases. See Aaron Bertrand's post:
https://blogs.sentryone.com/aaronbertrand/bad-habits-file-backups/
When installing a default instance of SQL Server Express at the Instance Configuration page, you must choose the Named Instance radio button and type in the default instance name of MSSQLSERVER.
All default instances use the MSSQLSERVER internally, but they just do not make it visible to you.
Context
StackExchange Database Administrators Q#122597, answer score: 5
Revisions (0)
No revisions yet.