• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 116
  • Last Modified:

SQL Server issue connecting to named instance

This is an odd one that I've never seen before. I'm hoping someone can shed some light.

I have a SQL Server database with a default instance and a named instance. For the sake of this conversation we'll call the named instance SQL2.

Using the local IP address I can connect to the named instance just fine. See screenshot below.
working - localHowever, using the public IP address the connection fails. See similar screenshot below. (Public IP address is made up)
not working - publicFurther complicating things is that if I use the explicit port number instead of the named instance it works again.
working - publicI've never seen a case of a named instance failing to connect like this. There must be some kind of configuration issue I'm overlooking. Can anyone suggest a solution?
0
Russ Suter
Asked:
Russ Suter
1 Solution
 
lcohanDatabase AnalystCommented:
did you tried adding a alias name for the instance? You'll need the SQL Server Configuration Manager. Go to Sql Native Client Configuration, Select Client Protocols, Right Click on TCP/IP and set your default port there.

https://msdn.microsoft.com/en-us/library/ms177440.aspx
<<Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)>>
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Use Configuration Manager and check what protocols have you enabled for this SQL Server instance.
0
 
mironCommented:
Please read the following article: Configure the Windows Firewall to Allow SQL Server Access, URL: https://msdn.microsoft.com/en-us/library/cc646023.aspx

Relevant points:

1_
SQL Server default instance running over TCP TCP port 1433

2_
SQL Server Browser service UDP port 1434 The SQL Server Browser service listens for incoming connections to a named instance and provides the client the TCP port number that corresponds to that named instance. Normally the SQL Server Browser service is started whenever named instances of the Database Engine are used. The SQL Server Browser service does not have to be started if the client is configured to connect to the specific port of the named instance.  

3_
Entire subsection Configure a Windows Firewall for Database Engine Access, URL https://msdn.microsoft.com/en-us/library/ms175043.aspx

Document portion
A_
To open access to SQL Server when using dynamic ports
In the Program dialog box, select This program path. Click Browse, and navigate to the instance of SQL Server that you want to access through the firewall, and then click Open. By default, SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Click Next. ( please note, application Sqlservr.exe location can differ in actual installation )

To summarize, ensure the following ports are opened for successfull connection to SQL Server:

UDP port 1434
TCP port 1433 ( Default instance )
TCP port for application sqlservr.exe ( Named instance dynamic port configuration )

-- cheers
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Russ SuterAuthor Commented:
I'm looking into the SQL Server Browser service. The perimeter firewall may be blocking UDP traffic on port 1434. Unfortunately I don't have access to configure that firewall so I've submitted a request. I'll get back to you.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
What for do you need the SQL Browser service running? This is only needed if you use Name Pipes protocol. Is that what you want?
0
 
Russ SuterAuthor Commented:
Opening Port 1434 to UDP traffic did the trick.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now