Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 SP to call SQL Cluster Name

Author  Topic 

jayhawk
Starting Member

3 Posts

Posted - 2004-01-07 : 12:45:10
Question, and please excuse my ignorance as I am not a developer.

Currently I am working with an application that has a SP that calls the instance name (usually default), stores it and uses this information along with the database name and a key to license the product.

My question is, what is the syntax or command that I could use in a SP that would call the node name or virtual server name of a SQL 2 node cluster ?

The issue is , this database will be part of an active/active cluster and the database will live on one of the nodes unless a failure occurs. But the issue is , if a failure occurs, the machine name and possibly the instance name will change upon failover. I would rather point this SP license to the node name / cluster name of the SQL Cluster.

Thanks in advance to everyone !

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-07 : 12:56:16
You do not refer to the instance by servername\instancename. There is a cluster name. So you refer to it as clustername\instancename

For instance, we have a 2 node cluster with names say Server1 and Server2. But we named the cluster Cluster1. We have an instance name instance1. So you would refer to the named instance as Cluster1\instance1. You do not use Server1 or Server2 when referring to it.

The cluster name is stored in the registry. To read it, you can use xp_regread. But don't bother since the cluster name won't change, so you can use it regardless of a failover.

Tara
Go to Top of Page
   

- Advertisement -