How to Identify Port Number of SQL Server

How to find SQL Server running port?

Try this:

USE master
GO
xp_readerrorlog 0, 1, N'Server is listening on'
GO

http://www.mssqltips.com/sqlservertip/2495/identify-sql-server-tcp-ip-port-being-used/

How can I find sql server port number from windows registry?

SQL Server 2000

Default instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\TCP

Named instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP

SQL Server 2005

There is no distinction between default and named instances. An instance is assigned a number based on the order it was installed. We first need to locate the registry key for the instance, which looks like

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.#

'#' is the number assigned to the instance. The instance name is stored as the default value for this registry key. For a default instance, it is MSSQLSERVER.

Once the registry key for the instance is found, we know the TCP/IP registry key is

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.#\MSSQLServer\SuperSocketNetLib\TCP\IPAll

SQL Server 2008

Default instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\TCP\IPAll

Named instance

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP\IPAll

More information here.

What port is a remote SQL Server 2005 running on?

SQL Server's default port is 1433. If you are unable to connect, you may have to make sure your firewall settings are correct.

Alternatively you can find out which port SQL Server is running by opening your command prompt: (Start > Run > CMD). Type "netstat" and hit enter, this will show you what you're looking for.

You could also check SQL Server's Error Log on the remote server to determine the port. Here are some more intracate ways of determining the port.

Additional information about ports right here on SO.



Related Topics



Leave a reply



Submit