• 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]
  • 相关阅读:
    Unity之图片压缩,批量设置,导入自动设置
    Unity之可寻址资源之初始化,下载
    最优二叉树
    独立任务最优调度问题
    石子合并问题
    linux初学笔记
    码农
    用循环打印出多种三角形
    人机猜拳(这是最近的一个总结)
    期末总结
  • 原文地址:https://www.cnblogs.com/kulong995/p/2039021.html
Copyright © 2020-2023  润新知