
[dbo].[IncreaseTransientSnapshotRefcount]
CREATE PROCEDURE [dbo].[IncreaseTransientSnapshotRefcount]
@SnapshotDataID as uniqueidentifier,
@IsPermanentSnapshot as bit,
@ExpirationMinutes as int
AS
DECLARE @soon AS datetime
SET @soon = DATEADD(n, @ExpirationMinutes, GETDATE())
if @IsPermanentSnapshot = 1
BEGIN
UPDATE SnapshotData
SET ExpirationDate = @soon, TransientRefcount = TransientRefcount + 1
WHERE SnapshotDataID = @SnapshotDataID
END ELSE BEGIN
UPDATE [ReportServerTempDB].dbo.SnapshotData
SET ExpirationDate = @soon, TransientRefcount = TransientRefcount + 1
WHERE SnapshotDataID = @SnapshotDataID
END
GO
GRANT EXECUTE ON [dbo].[IncreaseTransientSnapshotRefcount] TO [RSExecRole]
GO