If you are configuring a SQL Server to be used as an Session State for ASP.NET you need to configure the proper security to allow the application pool to access the SQL Server, you can use the following script to configure the security, remember to configure the proper identity (the one that is configured in the application pool)

 

use ASPState

go

grant EXECUTE on GetHashCode to [ApplicationPoolIdentity]

grant EXECUTE on GetMajorVersion to [ApplicationPoolIdentity]

grant EXECUTE on TempGetAppID to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItem to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItem2 to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItem3 to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItemExclusive to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItemExclusive2 to [ApplicationPoolIdentity]

grant EXECUTE on TempGetStateItemExclusive3 to [ApplicationPoolIdentity]

grant EXECUTE on TempGetVersion to [ApplicationPoolIdentity]

grant EXECUTE on TempInsertStateItemLong to [ApplicationPoolIdentity]

grant EXECUTE on TempInsertStateItemShort to [ApplicationPoolIdentity]

grant EXECUTE on TempInsertUninitializedItem to [ApplicationPoolIdentity]

grant EXECUTE on TempReleaseStateItemExclusive to [ApplicationPoolIdentity]

grant EXECUTE on TempRemoveStateItem to [ApplicationPoolIdentity]

grant EXECUTE on TempResetTimeout to [ApplicationPoolIdentity]

grant EXECUTE on TempUpdateStateItemLong to [ApplicationPoolIdentity]

grant EXECUTE on TempUpdateStateItemLongNullShort to [ApplicationPoolIdentity]

grant EXECUTE on TempUpdateStateItemShort to [ApplicationPoolIdentity]

grant EXECUTE on TempUpdateStateItemShortNullLong to [ApplicationPoolIdentity]

go

 

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10" sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI" sqlCommandTimeout="30" customProvider="" cookieless="UseCookies" cookieName="ASP.NET_SessionId" timeout="20" allowCustomSqlDatabase="false" regenerateExpiredSessionId="true" partitionResolverType="" useHostingIdentity="true" > <providers> <clear /> </providers> </sessionState>

 

Regards,

 

Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

http://mswindowscr.org

http://comunidadwindows.org

Costa Rica

Technorati Tags: SQL Server

LiveJournal Tags: SQL Server

del.icio.us Tags: SQL Server

http://ecastrom.blogspot.com

https://ecastrom.wordpress.com

http://ecastrom.spaces.live.com

http://universosql.blogspot.com

http://todosobresql.blogspot.com

http://todosobresqlserver.wordpress.com

http://mswindowscr.org/blogs/sql/default.aspx

http://citicr.org/blogs/noticias/default.aspx

http://sqlserverpedia.blogspot.com/Note: Cross posted from Eduardo Castro.

Permalink