
[dbo].[DecreaseTransientSnapshotRefcount]
CREATE PROCEDURE [dbo].[DecreaseTransientSnapshotRefcount]
@SnapshotDataID as uniqueidentifier,
@IsPermanentSnapshot as bit
AS
if @IsPermanentSnapshot = 1
BEGIN
UPDATE SnapshotData
SET TransientRefcount = TransientRefcount - 1
WHERE SnapshotDataID = @SnapshotDataID
END ELSE BEGIN
UPDATE [ReportServerTempDB].dbo.SnapshotData
SET TransientRefcount = TransientRefcount - 1
WHERE SnapshotDataID = @SnapshotDataID
END
GO
GRANT EXECUTE ON [dbo].[DecreaseTransientSnapshotRefcount] TO [RSExecRole]
GO