Visual C# Tutorials

ADO.NET and Database Tutorials and Lessons

Installing SQL Server 2008 Express

We will be using Microsoft SQL Server 2008 Express as our main data source. SQL Server is already installed if you have Visual C# Express or Visual Studio 2010, provided that you didn't uncheck the option of installing SQL Server during installation. We will also be using the SQL Management Studio Express which is a program that contains graphical tools for creating databases. Even if SQL is already installed via the installation of Visual C# Express, the SQL Management Studio might still not be installed. To check if it is already installed, go to Start > All Programs > Microsoft SQL Server 2008 and check if SQL Management Studio is there. If not, then you have to download and install it first. Don't worry though if you don't have SQL Management Studio as I will present two ways on creating and manipulating databases; using SQL Management Studio and using the simple command prompt. If you don't have SQL Server 2008 and SQL Management Studio, then you can download and install it manually. The following shows you step by step guide on how to do download and install them to your computer.

First step is to download an all-in-one package containing Microsoft SQL Server 2008 and Microsoft SQL Server Management Studio using the following link.

Download Microsoft SQL Server 2008

When you arrive at the download page, click the SQL Server 2008 R2 Express tab.

Downloading SQL Express 01

You will now choose which system you are currently using as described earlier. Choose the type of system you have (32-bit or 64-bit).

Downloading SQL Express 02

You will be taken to another page. Choose your language desired using the drop down list and then click the download button.

Downloading SQL Express 03

Once you have downloaded the installer, execute it to begin installation. The following shows step by step instructions on how to install Microsoft SQL Server 2008 R2 Express Edition and the SQL Server Management Studio.

Installing SQL Server Express 01

The installer will begin extracting required files for the installation. Wait for it to finish.

Installing SQL Server Express 02

The SQL Server Installation Center will show up. Be sure the "Installation" is selected. Since we will be installation SQL Server, choose the first option.

Installing SQL Server Express 03

Wait for the installation to start up.

Installing SQL Server Express 04

In this window, read the License Terms and check the first check box to accept it. Click Next to proceed to the next step.

Installing SQL Server Express 05

Wait again for the installer to load the required installation files.

Installing SQL Server Express 06

The setup will check for your system for required components. If it sees a missing component, then you need to download and install them first. Click Next if no errors were detected.

Installing SQL Server Express 07

This window allows you to select different features and the installation path for your SQL Server Express. Leave everything as is and click Next.

Installing SQL Server Express 08

This window asks for the name of the database instance that will be used by SQL Server Express. You can name it anything you want but it is recommended to leave it to its default name of SQLEXPRESS.

Installing SQL Server Express 09

The following window might be automatically skipped during installation. It shows the disk space requirements needed by the program. Click Next.

Installing SQL Server Express 10

This window specifies the accounts that will have access to the database. Change the account name of the first row to
NT AUTHORITY\SYSTEM and the second row to NT AUTHORITY\LOCAL and be sure that both has their Startup Type as Automatic.Click Next.

Installing SQL Server Express 11

This window allows you to choose an authentication type. Choose Mixed Mode to allow both Windows Authentication and database authentication. You will also need to provide a password for the sa (System Administrator Account) which will have full credentials and control with the databases. Please make sure that you remember that password that you will type. You can also add more users to your database, but for this tutorial, we won't be needing that. Click Next.

Installing SQL Server Express 12

This window gives you an option to send error reports to Microsoft so they can fix it. It is up to you to check the option or you can simply ignore this and click Next.

Installing SQL Server Express 13

The setup will now begin installing Microsoft SQL Server 2008 R2 Express. Wait for the installation progress to finish. Then click Next.

Installing SQL Server Express 14

Congratulations, you have now successfully installed Microsoft SQL Server 2008 R2 Express. Click Close. Close the SQL Server Installation Center if it is still open.


Previous Lesson
SQL Basics

Index
ADO.NET and Databases

Next Lesson
Creating a Sample Database and Table