Ask a questionAsk a question
 

AnswerSQL Server Port 1433

  • Friday, November 06, 2009 2:41 PMchucksalerno Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I have an application running on a mobile device that connects to a SQL Server 2005 database via a cellular/internet connection. My question is how does SQL Server manage contention for port 1433? Does the OS roll to the next port if 1433 is busy? How many devices can realistically be out in the field pinging that port?

    Can someone explain or direct me to a document that explains this?

    Thanks


    chuck

Answers

  • Friday, November 06, 2009 5:34 PMDan BenediktsonMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Chuck,
      A "default" instance of SQL Server will be assigned to listen on port 1433 and will not come online if port 1433 is taken by another application on the server. However, many client connections to a single server port are allowed by TCP, so there is really no upper limit to how many external connections to that one server port are active at a given time.
    This post is provided 'as is' and confers no express or implied warranties or rights.

All Replies

  • Friday, November 06, 2009 3:35 PMMichael Aspengren - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    By default SQL Server 2005 uses dynamic ports. If there is only one instance, the prefered port is 1433.
    If dynamic ports are enabled and 1433 is taken on SQL Server startup, a new port will be assigned.
    This port number will then be returned to the client via the SQL Brower service, the client will then use the returned portnumber
    and instanciate the proper connection to that port.

    That is how it works in the 'normal' world at least. Not sure how mobile devices works.
    Note that if you in your application connection string use IP and port, a call to SQL Browser will not be done, it will only try on that port and fail if
    the port has been set to something else than what you have in the connectionstring.

    Some more info
    "SQL Server Browser Service"
    http://msdn.microsoft.com/en-us/library/ms181087(SQL.90).aspx

    //Michael
    This posting is provided "AS IS" with no warranties.
  • Friday, November 06, 2009 5:34 PMDan BenediktsonMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Chuck,
      A "default" instance of SQL Server will be assigned to listen on port 1433 and will not come online if port 1433 is taken by another application on the server. However, many client connections to a single server port are allowed by TCP, so there is really no upper limit to how many external connections to that one server port are active at a given time.
    This post is provided 'as is' and confers no express or implied warranties or rights.