Port number

  • hi All,

      Do you know the port number on which the sql server is running ?

    Thanks in advance

    Suresh

  • by default on default instance the port is 1433. If you want to find the port on multiple instance. Run the below query

    DECLARE @key VARCHAR(100)

    DECLARE @PortNumber VARCHAR(20)

    SET @key = 'SOFTWARE\MICROSOFT'

    IF CHARINDEX('\',@@SERVERNAME,0) <>0

    BEGIN

     SET @key = @key + '\Microsoft SQL Server\' + @@SERVICENAME

    END

    ELSE

    BEGIN

     SET @key = @key + '\MSSQLServer'

    END

    SET @key = @key  + '\MSSQLServer\Supersocketnetlib\TCP'

    EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',

     @key=@key,@value_name='Tcpport',@value=@PortNumber OUTPUT

    SELECT @PortNumber

     

     


    Kindest Regards,

    Amit Lohia

  • You can also get it from EM.  Right click the instance - Properties - Network Configuration - TCP/IP - Properties.

  • What about SQL server 2005? How to get port number of sql server 2005 instance?

  • I got the answer from this same forum....here is the method to find out port number of sql server 2005

    Sql Server Configuration Manager >

    Sql Native Client Configuration > Client Protocols

    > double-click (e.g. ) TCP/IP.

    "Default port" is top item.

    The server has it's own settings

    See

    ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2276a5ed-ae3f-4855-96d8-f5bf01890640.htm

    under "How To" in sql BOL

    Bill

Viewing 5 posts - 1 through 4 (of 4 total)

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