SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

SQL Server Port Number Identifier

By Rudy Panigas,

Just copy and paste the T-SQL code and execute to get the port number used by SQL server. This is how it works.

  • Determine which version of SQL server you are running
  • Look at the specific location in the registery
  • Display the port number


I have tested this script on the following versions

  • SQL 2000 - 32 bit
  • SQL 2005 - 32 and 64 bit
  • SQL 2008 - 32 and 64 bit
  • SQL 2008R2 - 32 and 64 bit

It is quick, simple and could be executed on develoopment and production servers as there are not changes being made to SQL server and/or the Window's registery.


You will need to ensure you have rights to read the register in order for the script to execute properly and must be executed on each instance (this version) to get the port number)



Total article views: 2727 | Views in the last 30 days: 4
Related Articles

Using OVER() to Fix Bad Version Numbers

See how the OVER() clause was used in a live system to fix overlapping field version numbers.


Version Numbers in DB Name?

Does anyone support databases that have version numbers in their name and is it really necessary/val...


SQL Server 2016 - “Number of Rows Read” on Execution plan

One of the coolest things to release with SQL Server 2016 was “Number of Rows Read” information in...


Parallel Execution in SSIS 2008 and later version

SQL Server Integration Services (SSIS) execution is sequential by default. SQL Server Integration ...


version difference SQL server 2000

version difference Sql server 2000