Sometimes SQL developers want to put some logic into their T-Sql code to check the SQL Server failover cluster configuration mode . The SERVERPROPERTY() built in metadata system function can be used to identify the failover cluster configuration. SERVERPROPERTY() function with IsClustered Property will return “0” for Not Clustered mode and “1” for Clustered mode.
1 2 3 4 5 6 7 |
USE [master]; GO SELECT CASE SERVERPROPERTY('IsClustered') WHEN 0 THEN 'Not Clustered mode' WHEN 1 THEN 'Clustered' ELSE 'Unknown' END as [SQL Server failover cluster mode] |
Leave a Comment