Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Databases»SQL Server»How To Create ASPState Database in SQL Server

    How To Create ASPState Database in SQL Server

    By RahulDecember 3, 20142 Mins ReadUpdated:August 7, 2021

    The ASPStage (ASP.NET Session State) provides you the option to store website session data to the SQL server database. This is a useful option with load balancing, where application deployment is on multiple servers. This tutorial will help you to create an ASPState database in SQL server with the command line.

    Advertisement

    Prerequsities

    You must have installed the .net framework on your system to complete this task.

    Create ASPState Database

    After installing the .net framework on your system, open the windows command prompt and navigate to the framework installation directory as per your installed version of the .net framework and system architecture.

    Syntax:

    aspnet_regsql.exe -ssadd -sstype p -S {SQL Instance} -U {Username} -P {Password}
    

    Implementation:

    Navigate to the .net framework directory as followings:

    c:\> cd "%windir%\Microsoft.NET\Framework64\v4.0.30319"
    

    Directory path may be changed as per your installation like below.

    .NET Framework 2.0/3.0/3.5 (32-bit): %windir%\Microsoft.NET\Framework\v2.0.50727
    .NET Framework 2.0/3.0/3.5 (64-bit): %windir%\Microsoft.NET\Framework64\v2.0.50727
    .NET Framework version 4.x (32-bit): %windir%\Microsoft.NET\Framework\v4.0.30319
    .NET Framework version 4.x (64-bit): %windir%\Microsoft.NET\Framework64\v4.0.30319
    

    Now execute following command to finally create database named ASPState in SQL server defined instance. As per below command DB1SQLEXPRESS is my SQL instance.

    aspnet_regsql.exe -ssadd -sstype p -S DB1SQLEXPRESS -U sa -P myPassword
    

    On successful execution of the above command, you will get output like below.

    Microsoft (R) ASP.NET SQL Registration Tool version 4.0.30319.33440
    Administrative utility to install and uninstall ASP.NET features on a SQL server.
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Start adding session state.
    .........................
    Finished.
    

    aspstate database mssql session SQL SErver
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Installing MySQL 8.0 on Amazon Linux 2

    How To Install MySQL 8 on Amazon Linux 2

    (Resolved) Unknown collation: utf8mb4_unicode_520_ci

    How to Install MariaDB on Ubuntu 22.04

    How to Install MariaDB on Ubuntu 22.04

    View 2 Comments

    2 Comments

    1. Vikas on August 27, 2019 11:06 am

      Thanks! it’s helpful to us

      Reply
    2. Mawat on May 11, 2017 1:35 pm

      Thanks Rahul.. nice post

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.