Session DB RRS feed

  • Question

  • Hi,

    Need one help on sessiondb.

    We need to create a sessiondb for our application and enable the newly created db to store session. We have followed the steps to create the db as provided in the below link.


    While following the steps as mentioned in the link we are getting below error.

    Database: [ASPNETDB]

    SQL file loaded:


    Commands failed:

    /* Drop all tables, startup procedures, stored procedures and types. */

    /* Drop the DeleteExpiredSessions_Job */

    DECLARE @jobname nvarchar(200)

    SET @jobname = N'ASPNETDB' + '_Job_DeleteExpiredSessions'

    -- Delete the [local] job

    -- We expected to get an error if the job doesn't exist.

    PRINT 'If the job does not exist, an error from msdb.dbo.sp_delete_job is expected.'

    EXECUTE msdb.dbo.sp_delete_job @job_name = @jobname

    SQL Exception:

    System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was denied on the object 'sp_delete_job', database 'msdb', schema 'dbo'.

    If the job does not exist, an error from msdb.dbo.sp_delete_job is expected.

       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHa

    ndler, TdsParserStateObject stateObj, Boolean& dataReady)

       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, B

    oolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

       at System.Web.Management.SqlServices.ExecuteFile(String file, String server, String database, String dbFileName, SqlConnection connection, Boolean ses

    sionState, Boolean isInstall, SessionStateType sessionStatetype)


    Please let me know how to resove this issue and create session DB to store session ID in sql server.I am using SQL server 2012.



    • Moved by Amanda Zhu Wednesday, September 3, 2014 8:33 AM
    Tuesday, September 2, 2014 4:29 AM


All replies