Stored Procedures [dbo].[SetSessionCredentials]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@SessionIDvarchar(32)32
@OwnerSidvarbinary(85)85
@OwnerNamenvarchar(260)520
@AuthTypeint4
@DataSourceInfoimage16
@Expirationdatetime8
@EffectiveParamsntext16
Permissions
TypeActionOwning Principal
GrantExecuteRSExecRole
SQL Script
CREATE PROCEDURE [dbo].[SetSessionCredentials]
@SessionID as varchar(32),
@OwnerSid as varbinary(85) = NULL,
@OwnerName as nvarchar(260),
@AuthType as int,
@DataSourceInfo as image = NULL,
@Expiration as datetime,
@EffectiveParams as ntext = NULL
AS
DECLARE @OwnerID uniqueidentifier
EXEC GetUserID @OwnerSid, @OwnerName, @AuthType, @OwnerID OUTPUT
EXEC DereferenceSessionSnapshot @SessionID, @OwnerID
UPDATE SE
SET
   SE.DataSourceInfo = @DataSourceInfo,
   SE.SnapshotDataID = null,
   SE.IsPermanentSnapshot = null,
   SE.SnapshotExpirationDate = null,
   SE.ShowHideInfo = null,
   SE.HasInteractivity = null,
   SE.AutoRefreshSeconds = null,
   SE.Expiration = @Expiration,
   SE.EffectiveParams = @EffectiveParams,
   SE.AwaitingFirstExecution = 1
FROM
   [ReportServerTempDB].dbo.SessionData AS SE
WHERE
   SE.SessionID = @SessionID AND
   SE.OwnerID = @OwnerID

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