Determine Active Node in SQL Failover Cluster
This works in newer versions:
SELECT * FROM fn_virtualservernodes();
full details at https://docs.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-virtualservernodes-transact-sql?view=sql-server-2017
SELECT * FROM sys.dm_os_cluster_nodes;
full details at https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-cluster-nodes-transact-sql?view=sql-server-2017
Select ServerProperty('ComputerNamePhysicalNetBIOS')