Stored Procedures [dbo].[DeleteExpiredPersistedStreams]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Permissions
TypeActionOwning Principal
GrantExecuteRSExecRole
SQL Script
CREATE PROCEDURE [dbo].[DeleteExpiredPersistedStreams]
AS
SET DEADLOCK_PRIORITY LOW
DELETE
    [ReportServerTempDB].dbo.PersistedStream
FROM
    (SELECT TOP 1 * FROM [ReportServerTempDB].dbo.PersistedStream PS2 WHERE PS2.RefCount = 0 AND GETDATE() > PS2.ExpirationDate) AS e1
WHERE
    e1.SessionID = [ReportServerTempDB].dbo.PersistedStream.[SessionID] AND
    e1.[Index] = [ReportServerTempDB].dbo.PersistedStream.[Index]
    

GO
GRANT EXECUTE ON  [dbo].[DeleteExpiredPersistedStreams] TO [RSExecRole]
GO
Uses