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 thoughts on “How to find the current/active machine in SQLServer cluster?

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s