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.
SELECT CASE SERVERPROPERTY('IsClustered')
WHEN 0 THEN 'Not Clustered mode'
WHEN 1 THEN 'Clustered'
END as [SQL Server failover cluster mode]