Site icon An Oracle Spin by Alex Lima

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

Exit mobile version