Click here to monitor SSC
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 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: 2362 | Views in the last 30 days: 2
 
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