Share via


How do you refer to the default instance....what's its name?

Question

Saturday, February 24, 2018 2:51 PM

Because I develop in more than one version of SQL Server I've gotten in the habit of always naming instances, even if it's on a client's system where only one instance is going to be installed. For that reason, I always have to refer to the instance as <server name>\instance name>. But I had a client install SQL Server 2012 on a new box last week without giving it an instance name. It's all good. Everything's working fine. My question is this: CAN you refer to it with an instance name or are you ONLY able to refer to it as the server name? I tried using the default name (as shown in the services management window ("MSSQLSERVER") but it didn't work. I mean their server name is "OUR-SERVER" (well it's not, but for argument purposes here). So when I start up SSMS and enter "OUR-SERVER" it lets me into that SQL Server instance. But if I use "OUR-SERVER\MSSQLSERVER" it doesn't work. Should it? Or are we ONLY able to use the "OUR-SERVER" in this case? Also, is it possible to give it a name after it's been installed? I'm not suggesting I want to do that. I'm mostly just curious.

Thanks,

Keith

All replies (6)

Saturday, February 24, 2018 4:47 PM ✅Answered

No, it is not possible. 


Saturday, February 24, 2018 5:27 PM ✅Answered

No, it is not possible to connect to hostname\instancename when no named instance was installed. This is by design.

On a default (no-name) instance, just use hostname only for SQL connections.

HTH,

Phil Streiff, MCDBA, MCITP, MCSA


Sunday, February 25, 2018 5:58 AM ✅Answered

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."

Olaf Helper

[ Blog] [ Xing] [ MVP]


Saturday, February 24, 2018 3:35 PM

You should be able to make a SQL connection string with just the hostname, when default (no-name) SQL is installed. In your case: "OUR-SERVER". 

MSSQLSERVER is just the name of the SQL service after installing default instance, not an instance name. So, "OUR-SERVER\MSSQLSERVER" is not the true instance name and that's why connections attempts to it fail.

Secondly, it is not possible to change a SQL instance name after it has been installed. The only way to accomplish that is to uninstall SQL Server and then re-install, it specifying an instance name during installation.

HTH,

Phil Streiff, MCDBA, MCITP, MCSA


Saturday, February 24, 2018 3:38 PM

"You should be able to make a SQL connection string with just the hostname" ..... Yes. Thank you. I said that clearly in my O.P. I know I can refer to it with just the hostname. I'm asking  IS IT POSSIBLE to use the hostname\instancename? I can't seem to get it to work. I said, "Should it?" Meaning, "should it work?" Is there a way to refer to it as hostname\instancename?


Sunday, February 25, 2018 4:09 PM

The only way is to trick the client app. But that requires a config on the client machine. SQL Server Configuration Manager (in the end stored in the registry), you can configure an alias name (including the instance name) for your default instance. Like MAXHINEX\INSTANCEY points to MACHINEX.

Tibor Karaszi, SQL Server MVP (Web Blog)