1

I have a new server that is configured using a dynamic port as you can see below:

enter image description here

The application that connects to this server uses the following connection string, but I am getting the following error:

enter image description here

I asked the developer to change the connection port from 61844 to 53187, which is my dynamic port.

After done that and restarting their services, the application could connect to SQL Server.

Is there any specific reason it needs to be using a dynamic port?

1

2 Answers 2

2

Say that something else uses the port that you have configured for your SQL Server: What do you prefer? The SQL Server to start but use a different port? Use dynamic. Not start at all? Use static.

Another aspect is that your developers seem to have hard-wired the port number in the application (connection string) i.e., connect to something e.g. yourserver,45346. That is one way to do it. Another way is to connect using the instance name such as yourserver\instancename. This way the port resolution is handled for you, but it requires that the SQL Server browser service is started on the server machine and you can reach it using UDP port 1434 for the name->portnumber "query".

2
  • 1
    Often people revert to server,port when they can't (or can't be bothered to) figure out why the translation isn't handled for them (usually browser service is not running or network protocols are not enabled). Oct 15, 2018 at 14:56
  • @AaronBertrand you add meaningful details, TA for being around! Oct 15, 2018 at 16:25
0

Is there any specific reason it needs to be using a dynamic port?

There is no good reason to continue using a dynamic port. They are used by default for named instances because there is no well-known port for SQL Server other than 1433, and so the only reliable way to open a listening port is to pick an available one at startup.

You should routinely pick fixed port for each instance to enable clients to connect without an instance name, and without using the SQL Browser service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.