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
Differencebetween '->>' and '->' in Postgres SQL
New Line Issue When Copying Data from SQL Server 2012 to Excel
How to Find "Holes" in a Table
SQL Server 2008: Delete Duplicate Rows
Are Left Outer Joins Associative
Which One Have Better Performance:Derived Tables or Temporary Tables
Iterate Through Rows in SQL Server 2008
What Are the Main Differences Between Option(Optimize for Unknown) and Option(Recompile)
Dropping Multiple Partitions in Impala/Hive
Check If Stored Procedure Is Running
SQL Server: Invalid Column Name
Singular or Plural Database Table Names
Tricks for Generating SQL Statements in Excel
How to Count the Number of Columns in a Table Using SQL
Mysql: How to Sum() a Timediff() on a Group