Invalid object name 'ASPState.dbo.ASPStateTempApplications' - Exception after renaming the ASPState Database

Ravi picture Ravi · Jul 17, 2010 · Viewed 12.2k times · Source

I have created new session database using the command (aspnet_regsql.exe -S -E -ssadd -sstype p) and it created DB called ASPState. Then I renamed it to something like E_ASPStateDB. I have configured the correct DB name in the sessionState connection string. But still it throws the exception Invalid object name 'ASPState.dbo.ASPStateTempApplications'

What i need to do, so that it will use the new database name?

Answer

SureshNT picture SureshNT · Jan 2, 2014

I ran this on the db server that the site was connecting to and it solved it immediately.

USE [ASPState]
GO

DECLARE @return_value int

EXEC    @return_value = [dbo].[CreateTempTables]

SELECT  'Return Value' = @return_value

GO