How to enter server name in SQL Server

429 views Asked by At

I have two clients.

I want connect another system, that system has the IP 192.168.0.222 and an instance name of proc-job\MSSQLSERVER1 .

I server name I entered is 192.168.0.222\proc-job\MSSQLSERVER1 .

But I can't connect to that.

What's the problem?

When I entered 192.168.0.222 it connects to the default instance .

2

There are 2 answers

0
TTeeple On

Take out the server name. You don't need both the IP and server name when connecting to a SQL Server

0
Deepshikha On

The difference is that when you enter 192.168.0.222 in server name you created a connection to a default instance listening on TCP address 192.168.0.222 using an IP address. And when you tried to connect via 192.168.0.222\proc-job\MSSQLSERVER1 then proc-job\MSSQLSERVER1 should be a named instance.

An instance is either the default instance or a named instance. The default instance name is MSSQLSERVER; SQLExpress for SQL Server Express. It does not require a client to specify the name of the instance to make a connection. A named instance is determined by the user during Setup. You can install SQL Server as a named instance without installing the default instance first. The default instance could be an installation of SQL Server 2000, SQL Server 2005, or SQL Server 2008. Only one installation of SQL Server, regardless of version, can be the default instance at one time. You can read more here: https://msdn.microsoft.com/en-us/library/ms143531(v=sql.100).aspx

So for the default instance, it does not require a client to specify the name of the instance to make a connection. The client only has to know the server name. Ex: When you connected via 192.168.0.222 you actually connected to a default instance.

A named instance is identified by the network name of the computer plus the instance name that you specify during installation. The client must specify both the server name and the instance name when connecting. Ex: When you are trying to connect via server name 192.168.0.222 + an instance \proc-job\MSSQLSERVER1 then it has to be a named instance.

By default, SQL Server installs in the default instance unless you specify an instance name. SQL Server Express, however, always installs in a named instance unless you force a default installation during setup.