有没有一种方法可以在SQL Server查询中始终在群集名称上了解SQL

发布于 2025-02-01 14:50:24 字数 963 浏览 4 评论 0原文

我在群集设置上总是有一个SQL Server。群集名称是:

DBCLUSTER001.mydomain.net

它有几个节点(虚拟服务器)用于失败。

假设他们是:

Node1,
Node2, etc...

要知道哪个节点当前处于活动状态,我运行的

SELECT activeServer = @@SERVERNAME;
-- Let's say, it resulted in 'Node1'

是我要找出的是有一个SQL命令或查询,我可以从当前的Active Node(node1)中运行以获取群集名称?

就像

SELECT * 
FROM <something; a function, table, command> 
--my expected output is: DBCLUSTER001.mydomain.net

我想实现的是这样的事情。

我正在寻找 sql Server操作系统查询,但是到目前为止,它们都只给我节点信息。

实际上可以获取群集名称吗?

我正在使用SQL Server 2019。

I have a SQL Server Always On cluster set up. The cluster name is:

DBCLUSTER001.mydomain.net

It has a few nodes (virtual servers) for fail overs.

Let's say they are:

Node1,
Node2, etc...

To know which node is currently active I run this

SELECT activeServer = @@SERVERNAME;
-- Let's say, it resulted in 'Node1'

What I'm trying to find out that is there a SQL command or query that I can run from the current active node (Node1) to get the cluster name?

It's like if there is something like

SELECT * 
FROM <something; a function, table, command> 
--my expected output is: DBCLUSTER001.mydomain.net

This is what I'm trying to achieve.

I am looking in to the SQL Server Operating System queries, but so far they all are giving me the Node info only.

Is getting the cluster name actually possible?

I am using SQL Server 2019.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文