Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TSQL - how to tell if SQL is clustered?

Is there a way using TSQL, CMD Script or VB Script to tell:

1) if SQL Server is clustered on the server, and

2) if it is the active node or not?

Thanks.

like image 875
Neil Weicher Avatar asked Oct 13 '13 16:10

Neil Weicher


2 Answers

Both of these can be found using

 SELECT * FROM fn_virtualservernodes() 

If there are no results, it's not clustered.

like image 93
podiluska Avatar answered Oct 06 '22 23:10

podiluska


For active node you may try this to check the name of the node on which the clustered SQL Server instance is running on:

Select ServerProperty('ComputerNamePhysicalNetBIOS') 

and for checking if its clustered:

SELECT 'IsClustered', SERVERPROPERTY('IsClustered')

Also check this article and MSDN.

like image 43
Rahul Tripathi Avatar answered Oct 07 '22 00:10

Rahul Tripathi