Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server, convert a named instance to default instance?

I need to convert a named instance of SQL server 2005, to a default instance.

Is there a way to do this without a reinstall?


The problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of us. I am looking for the path of least resistance to getting these 2 back on to our teams standard setup.

Each has expressed that this is going to be, too much trouble and that it will take away from their development time. I assumed that it would take some time to resolve, in the best interest of all involved, I tried combing through configuration apps installed and didn't see anything, so I figured someone with more knowledge of the inner workings would be here.

like image 524
DevelopingChris Avatar asked Aug 29 '08 18:08

DevelopingChris


People also ask

Can we change named instance to default instance?

The only way to change the instance name is to re-install - uninstall and install as default instance.

What is SQL Server default instance?

For additional informations see Instance Name (SQL Server Express) => Default instance "The default instance name is MSSQLSERVER; it does not require a client to specify the name of the instance to make a connection."

Can I change the SQL Server instance name?

Please keep in mind that we cannot change complete name of SQL Server named instance. Suppose you have installed a named instance SERVERNAME\DBInstance1 on your server. If you want to rename this named instance then we can only change first part of this name i.e. SERVERNAME.


4 Answers

I also wanted to convert a named instance to default - my reason was to access it with just the machine name from various applications.

If you want to access a named instance from any connection string without using the instance name, and using only the server name and/or IP address, then you can do the following:

  • Open SQL Server Configuration Manager
  • Click SQL Server Network Configuration
  • Click Protocols for INSTANCENAME you want to make available (i.e. SQLExpress)
  • Right-click TCP/IP and click Enabled
  • Right-click TCP/IP and go to Properties
    • Go to the IP Addresses tab
    • Scroll down to the IPAll section
    • Clear the field TCP Dynamic Ports (i.e. empty/blank)
    • Set TCP Port to 1433
    • Click Ok
  • Go to SQL Server Services
  • Right-click your SQL Server (INSTANCENAME) and click Restart

SQL Server Configuration Manager

This will make the named instance listen on the default port. Note : You can have only one instance configured like this - no two instances can have same port on the IP All section unless the instance is a failover cluster.

like image 194
Zasz Avatar answered Oct 03 '22 23:10

Zasz


As far as I know, no. One reason is the folder structure on the hard drive; they will have a name like MSSQL10.[instancename]

like image 43
SQLMenace Avatar answered Oct 03 '22 22:10

SQLMenace


This is why a lot of companies store their applications' connection strings at the machine level instead of the application level.

Just take the connection string out of the source code entirely. Then have everyone put their connection string in their machine.config.

This has the added benefit of avoiding unnecessary app-specific environment logic, i.e. when you copy your application to the staging server, the staging server already "knows" what database to use.

like image 33
Portman Avatar answered Oct 03 '22 23:10

Portman


A lot of times I'll use client alias to point an application at a different sql server than the ones it's connection string is for, esp. handy when working on DTS or an application with a hard coded connection string. Have everybody use a commonly named alias, use the alias in the connection string and point the alias’s on each dev box to the to the different instances. That way you won't have to worry about if the server is the default instance or not.

like image 42
Booji Boy Avatar answered Oct 03 '22 22:10

Booji Boy