Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
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: 2676 | Views in the last 30 days: 11
Related Articles

Version Numbers in DB Name?

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


version difference SQL server 2000

version difference Sql server 2000


SQL Server Version (T-SQL)

SQL Server Version (T-SQL)


SSIS version in SQL Server

Integration Services is the management interface for  SSIS packages. SQL Server uses  the “MsDtsSrvr...


Version Control

Knowing which server holds which version?!?


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones