Quantcast
Channel: Learning is an aRT » Interview tips
Viewing all articles
Browse latest Browse all 2

Does my SQL Server part of failover clustering?

$
0
0

Below Sql command are usefull to retrive SQL Server detail.

-- Returns the list of nodes on which the virtual server can run. It may useful in failover clustering environments.
SELECT * FROM ::fn_virtualservernodes() [Cluster Node Name]
--fn_virtualservernodes is also available for version 2012 but Alternate to this SELECT * FROM sys.dm_os_cluster_nodes
-- If the current server instance is not a clustered server, fn_virtualservernodes returns an empty rowset.
--Show computer physical name
SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS'); [Computer Name]
--Cluster group name
SELECT CONVERT(varchar(128), serverproperty('MachineName')) as [Cluster Group]
Select @@SERVERNAME AS 'Server Name'
--Returns the name of the local server that is running SQL Server.
/*
Default instance 'servername'
Named instance 'servername\instancename'
failover clustered instance - default instance 'virtualservername'
failover clustered instance - named instance 'virtualservername\instancename'
*/
SELECT @@SERVICENAME AS 'Service Name'
/* Returns the name of the registry key under which SQL Server is running.
@@SERVICENAME returns 'MSSQLSERVER' if the current instance is the default instance; this function returns the instance name if the current instance is a named instance.*/



Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images