gpt4 book ai didi

sql-server - SQL Azure 仅返回 sys.dm_exec_sessions 中的一行

转载 作者:行者123 更新时间:2023-12-02 17:30:44 27 4
gpt4 key购买 nike

在本地 Microsoft SQL Server 中,当我发出此查询时:

从 sys.dm_exec_sessions 中选择*

我在 SSMS 中的每个窗口得到一条记录。如果我在 SSMS 中打开多个查询窗口,即使它们没有执行任何操作,我也会获得每个查询窗口的记录。在 Azure 中,当我发出相同的查询时,我只得到一条记录。更有趣的是,当 SSMS 中有多个窗口在 Azure 中进行事件工作时,我什至只得到一条记录。

这是屏幕截图:

SQL Azure http://s3temp.brentozar.com/azure1.png

在该屏幕截图中,SSMS 中有三个事件选项卡。其中两个正在运行巨大的插入语句,需要几秒钟才能执行,第三个正在查询 sys.dm_exec_sessions - 但我只得到一条记录。我在 sys.dm_tran_active_transactions 和 sys.dm_tran_database_transactions 中获得多个记录,但是如果我无法将其与各个 session 联系起来,这会改变我报告事件查询的方式。这是预期的行为,还是 MS 正在努力在 Azure vNext 中修复的问题?

最佳答案

Azure 的行为与 SQL 相同:

Permissions: Requires VIEW SERVER STATE permission on server.

Note: If the user has VIEW SERVER STATE permission on the server, the user will see all executing sessions on the instance of SQL Server; otherwise, the user will see only the current session.

关于sql-server - SQL Azure 仅返回 sys.dm_exec_sessions 中的一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2315060/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com