SUMMARY
This article includes script files that configure Microsoft SQL Server to support ASP.NET SQL Server mode session state management so that session data is persisted outside the
tempdb database. This article includes information to download these alternative script files, which are named InstallPersistSqlState.sql and UninstallPersistSqlState.sql.
Note The downloadable scripts that are referenced in this article are only intended for use with the Microsoft .NET Framework 1.0. You must not use these scripts with the Microsoft .NET Framework 1.1 because the .NET Framework 1.1 does not support them. Use the persistent scripts that are supplied with the .NET Framework 1.1 instead when you develop applications by using the .NET Framework 1.1.
back to the topRequirements
- Microsoft Windows XP, Microsoft Windows 2000 Professional, Microsoft Windows 2000 Server, or Microsoft Windows 2000 Advanced Server
- Microsoft .NET Framework
- Microsoft Internet Information Services (IIS)
- Microsoft SQL Server
back to the topDescription of the Technique
When you use the original SQL Server mode session state management script files (InstallSqlState.sql and UninstallSqlState.sql), the
ASPStateTempApplications and the
ASPStateTempSessions tables are created in the
tempdb database to store the session data. However, the session state data is lost if you restart the computer that is running SQL Server.
The persisting versions of the scripts (InstallPersistSqlState.sql and UninstallPersistSqlState.sql) resolve this problem by creating these tables in the
ASPState database instead. Therefore, the session data is retained after you restart the computer that is running SQL Server.
To obtain the InstallPersistSqlState.sql and the UninstallPersistSqlState.sql files, download the PersistSqlState.exe self-extracting executable file.
The following file is available for download from the Microsoft Download Center:
Release Date: April 23, 2002
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
back to the topConfigure Persistent SQL Server Mode Session State Management
To run the InstallPersistSqlState.sql script file that configures persisting SQL Server mode session state management, follow these steps:
- If you previously used the original InstallSqlState.sql file to configure SQL Server mode session state, you must run the original UninstallSqlState.sql file to remove SQL Server mode session state.
- In SQL Query Analyzer, click Open on the File menu.
- In the Open Query File dialog box, click InstallPersistSqlState.sql, and then click Open.
- Click Execute on the Query menu to execute the script file.
back to the topRemove the Persistent SQL Server Mode Session State Management Configuration
To run the UninstallPersistSqlState.sql script file that removes the persisting SQL Server mode session state management configuration, follow these steps:
- In SQL Query Analyzer, click Open on the File menu.
- In the Open Query File dialog box, click UninstallPersistSqlState.sql, and then click Open.
- You must stop the w3svc service before you execute the UninstallPersistSqlState.sql script. To stop the w3svc service, follow these steps:
- Click Start, and then click Run.
- Type cmd in the Open box, and then click OK.
- At the command prompt, type net stop w3svc. You receive a confirmation that the w3svc service has been stopped.
- In SQL Query Analyzer, click Execute on the Query menu to execute the script file.
- Restart the w3svc service after the uninstall is complete. To do this, type net start w3svc at a command prompt.
back to the topTroubleshooting
back to the topREFERENCES
For additional information about how to run default scripts that configure SQL Server for ASP.NET SQL Server mode session state management, click the article number below
to view the article in the Microsoft Knowledge Base:
317604 HOW TO: Configure SQL Server to Store ASP.NET Session State
For additional information about the
net start and the
net stop commands, click the article number below to view the article in the Microsoft Knowledge Base:
236166 Using NET STOP and NET START Commands to Force IIS Services to Re-Read the Registry
For additional information about ASP.NET and ASP.NET state management, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
307598 INFO: ASP.NET State Management Overview
For more information about ASP.NET session state management, see the following article from the
Nothin' but ASP.NET column on MSDN:
back to the top