SQL Server Setup

SQL Server Database Installation

These instructions are for using SessionFarm with Microsoft SQL Server (version 7 or higher). If you are planning on using a File Share for data storage you can skip this step.

  1. Create a new database or select an existing database to install the SessionFarm tables and stored procedures in.
  2. Open the SQL file containing the scripts to create the tables & stored procedures. Make sure you are logged in as DBO for that database or SA for the server. Make sure you have the correct database selected before executing the SQL statements. Execute them.
    SQL Server 7 & 2000 - SESSIONFARM.SQL
  3. The database should now have the following tables and stored procedures:
    Tables: Sessions
    Stored Procedures: Session_Save, Session_Load, Session_Abandon, Session_Purge
  4. Create a new user in the database (or use an existing one) that has execute rights on the stored procedures listed above.
  5. Create a new SQL Agent Job to execute Session_Purge every 12 or 24 hours. Ideally this job should be scheduled to run during a period of low activity (like 3 or 4 AM). This job will clear out old session data from the session tables.
  6. Configure your SQL database to truncate its Log File on checkpoint to prevent it from growing out of control. Session data is useless after the session is over, so there isn’t much need for Log Files to allow you to recover the database.
    SQL 2000 or higher: Database Properties / Options / Recover Model: select “Simple” from the drop-down list.
    SQL 7: Database Properties / Options / Truncate Log on Checkpoint: Check this box.