How to find the current/active machine in SQLServer cluster?

Using of the functions below one can find the current/active machine in SQLServer cluster.

Select ServerProperty(‘ComputerNamePhysicalNetBIOS’)
NODE2

— fn_virtualservernodes() returns all the nodes in cluster, the first record returned is the active
select top 1 * from fn_virtualservernodes()
NODE2

select * from fn_virtualservernodes()
NODE2
NODE1

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.