SQL Static Port

  • We have named SQL Server which uses Static Port (e.g: 4000).
    Application in the configuration uses that port  but somehow it is not sending data when using that port but is working fine with only the named instance without port.

    If the port is not defined, how is the application connecting to that named SQL instance.
    What port does it use?

    Thanks.

  • are you sure you've assigned a static port in the SQL configuration manager?
    The SQL Browser Service tells incoming connections to your instances which port to use, whether it's static or dynamic.
    if you were to stop the browser service, calls would need to include the explicit port.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yes, it is Static.

  • I'm a bit confused by what you mean when you say "Not sending data" when connecting via a port vs working file when using a named instance. i would expect an explicit failure to connect.

    does the server have more than one instance? could you be connecting to the default instance, and looking for changes in the named instance?

    so if both instances ahd the same users and database/tablename? so they could be confused with each other?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell - Tuesday, January 31, 2017 8:16 AM

    I'm a bit confused by what you mean when you say "Not sending data" when connecting via a port vs working file when using a named instance. i would expect an explicit failure to connect.

    does the server have more than one instance? could you be connecting to the default instance, and looking for changes in the named instance?

    so if both instances ahd the same users and database/tablename? so they could be confused with each other?

    The server has only one instance.
    If we do not specify any port to connect to the named instance which uses static port, would it use the static port by itself or what port does it look for?

  • the browser service helps application sort out the right place to connect.

    so assume that something is connecting with a connection string like this, and your sole SQL server instance is listening to port 4000

    Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

    in that case, if the SQL browser Service is running, the  browser directs the connection to the correct port; effectively, the  connectionstring is changed to 

    Server=myServerAddress,4000;Database=myDataBase;Trusted_Connection=True;

    if the browser service is not running, the port is assumed to be 1433

    Server=myServerAddress,1433;Database=myDataBase;Trusted_Connection=True;

    so if there is nothing listening there, unless something else is redirecting port traffic, you'd get a failure to connect.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thank you for the explanation.
    So , if the SQL Browser is running then no matter if we assign the static port or not, it would re-direct to the static port assigned to the SQL instance.

  • if i try to connect to an explicit wrong port, i'd get a connection timeout error, even if the SQL Browser is running.

    Server=myServerAddress,9999;Database=myDataBase;Trusted_Connection=True;

    TITLE: Connect to Database Engine
    ------------------------------
    Cannot connect to .MyServerAddress,9999.
    ------------------------------
    ADDITIONAL INFORMATION:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The remote computer refused the network connection.) (Microsoft SQL Server, Error: 1225)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=1225&LinkId=20476
    ------------------------------
    The remote computer refused the network connection
    ------------------------------
    BUTTONS:
    OK
    ------------------------------

    if enter an explicit port, that's what is tried to connect to, and the SQL browser doesn't really enter into the equation.

    if i put int he same port that the browser would direct me to, it's just co-incidence, and the browser service would not help in that case...only when i leave to port off of the connection, will teh service try to help.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply