SQL Server Profiler 跟踪不断出现检索数据

     用SQL Server Profiler跟踪SQL的时候,老是出现下面的执行.而且不间断,隔几秒就会出现一次,很是恼火.找了半天,发现是

ReportServer数据库里面的表.但是总不能删掉这个数据库把.后来网上找了下,关掉Report服务就行了,打开Reporting Services

配置管理器,停掉服务,总算清静了.继续优化项目.

 
  
declare @BatchID uniqueidentifier

set @BatchID = newid ()

UPDATE [ Notifications ] WITH (TABLOCKX)
SET [ BatchID ] = @BatchID ,
[ ProcessStart ] = GETUTCDATE(),
[ ProcessHeartbeat ] = GETUTCDATE()
FROM (
SELECT TOP 4 [ NotificationID ] FROM [ Notifications ] WITH (TABLOCKX) WHERE ProcessStart is NULL and
(ProcessAfter
is NULL or ProcessAfter < GETUTCDATE()) ORDER BY [ NotificationEntered ]
)
AS t1
WHERE [ Notifications ] . [ NotificationID ] = t1. [ NotificationID ]

select top 4
-- Notification data
N. [ NotificationID ] ,
N.
[ SubscriptionID ] ,
N.
[ ActivationID ] ,
N.
[ ReportID ] ,
N.
[ SnapShotDate ] ,
N.
[ DeliveryExtension ] ,
N.
[ ExtensionSettings ] ,
N.
[ Locale ] ,
N.
[ Parameters ] ,
N.
[ SubscriptionLastRunTime ] ,
N.
[ ProcessStart ] ,
N.
[ NotificationEntered ] ,
N.
[ Attempt ] ,
N.
[ IsDataDriven ] ,
SUSER_SNAME (Owner. [ Sid ] ),
Owner.
[ UserName ] ,
-- Report Data
O. [ Path ] ,
O.
[ Type ] ,
SD.NtSecDescPrimary,
N.
[ Version ] ,
Owner.
[ AuthType ]
from
[ Notifications ] N with (TABLOCKX) inner join [ Catalog ] O on O. [ ItemID ] = N. [ ReportID ]
inner join [ Users ] Owner on N.SubscriptionOwnerID = Owner.UserID
left outer join [ SecData ] SD on O. [ PolicyID ] = SD. [ PolicyID ] AND SD.AuthType = Owner.AuthType
where
N.
[ BatchID ] = @BatchID
ORDER BY [ NotificationEntered ]

转载于:https://www.cnblogs.com/kulong995/archive/2011/05/06/2039021.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值