首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >这些Server会话从哪里来?

这些Server会话从哪里来?
EN

Stack Overflow用户
提问于 2010-10-26 07:12:24
回答 1查看 7.2K关注 0票数 8

在我的开发机器上启动SSMS (2008 R2)之后,我用

代码语言:javascript
复制
"D:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" -nosplash -S localhost -d testdata

不做任何事,

在活动监视器中,我观察到一些会话(TestData是我的默认数据库)

第51次会议的详细情况:

代码语言:javascript
复制
select @@spid;
select SERVERPROPERTY('ProductLevel');

第52次会议的详情:

代码语言:javascript
复制
DBCC INPUTBUFFER(52)  

第53次会议的详细情况:

代码语言:javascript
复制
SELECT
CAST(serverproperty(N'Servername') AS sysname) AS [Name],
'Server[@Name=' + quotename(CAST(
        serverproperty(N'Servername')
       AS sysname),'''') + ']' + '/JobServer' AS [Urn]
ORDER BY
[Name] ASC

第五十四届会议详情:

代码语言:javascript
复制
SET NOCOUNT ON;

DECLARE @previous_collection_time datetime;
DECLARE @previous_request_count bigint;
DECLARE @current_collection_time datetime;
DECLARE @current_request_count bigint;
DECLARE @batch_requests_per_sec bigint;
DECLARE @interval_sec bigint;

-- Get the previous snapshot's time and batch request count
SELECT TOP 1 @previous_collection_time = collection_time, @previous_request_count = request_count 
FROM #am_request_count
ORDER BY collection_time DESC;

-- Get the current total time and batch request count
SET @current_collection_time = GETDATE();
SELECT @current_request_count = cntr_value 
FROM sys.sysperfinfo
WHERE counter_name = 'Batch Requests/sec' COLLATE Latin1_General_BIN;

SET @interval_sec = 
    -- Avoid divide-by-zero
    CASE
        WHEN DATEDIFF (second, @previous_collection_time, @current_collection_time) = 0 THEN 1
        ELSE DATEDIFF (second, @previous_collection_time, @current_collection_time)
    END;

-- Calc the Batch Requests/sec rate for the just-completed time interval. 
SET @batch_requests_per_sec = (@current_request_count - @previous_request_count) / @interval_sec;

-- Save off current batch count
INSERT INTO #am_request_count (collection_time, request_count) 
VALUES (@current_collection_time, @current_request_count);

-- Return the batch requests/sec rate for the just-completed time interval. 
SELECT ISNULL (@batch_requests_per_sec, 0) AS batch_requests_per_sec;

-- Get rid of all but the most recent snapshot's data
DELETE FROM #am_request_count WHERE collection_time < @current_collection_time; 

如果在没有选项的情况下启动SSMS (通过Windows身份验证连接到无名实例),那么我就没有与上面显示为52相对应的会话

我做了什么来启动所有这些会议?

我只是不记得我以前在开发Server 2008 R2中做了什么.

更新:

我将相同的选项还原到SSMS.exe (-nosplash -S localhost -d testdata),重新启动SSMS,现在有了与会话51详细信息相对应的不同详细信息:

代码语言:javascript
复制
DECLARE @edition sysname; 
SET @edition = cast(SERVERPROPERTY(N'EDITION') as sysname); 
select case when @edition = N'SQL Azure' then 1 else 0 end as 'IsCloud' 

为什么我以前没有呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-10-26 16:55:20

这些会话被用来将数据拖到活动监视器中。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4021428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档