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 Script

By Gregory Ferdinandsen,

This will iterate through multiple SQL Servers if run is SSMS and will print out the port number and SQL version.

 

Ideally, set the option in SSMS to display server name for multi-server queries to off, it makes for a cleaner result.

 

If the server cannot connect to a database (the DB is registered and server does not exist/access is denied), SQL will output some error, this is no big deal.

 

There seems to be an issue with clsueters, it usually works; however, sometime it cannot locate the registry for the registered server. This is unique to clustering and likely has to do with what node owns what resources.

 

I would guess, if TCP/IP were disabled for a server, it would also produce an error, as no port number would have been set.

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

Who would like to explain the uses of account guest in SQL SERVER?

Who would like to explain the uses of account guest in SQL SERVER?

ARTICLE

Would You Choose SQL Server?

This Friday Steve Jones has a poll asking how you feel about SQL Server for your own projects, or ev...

BLOG

Security Awareness for Developers - What would you include?

If you were putting together a security awareness training program for developers, what aspects of ...

FORUM

String or binary data would be truncated.

String or binary data would be truncated.

FORUM

String or binary data would be truncated.

String or binary data would be truncated.

Tags
general administration    
networking    
security    
tcp/ip    
 
Contribute

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
Editor, SQLServerCentral.com

Already a member? Jump in:

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