Setting up SQL SERVER 2008 R2 Database

To install and set up the SQL Server 2008 R2 database with a sample database so that you can practice working with a SQL server database, follow the steps given below:

Step 1: Login as Administrator. Use the following link to go to the Microsoft website with access to download the free SQL Server 2008 R2 database:

Step 2: Select the option with Microsoft SQL Server 2008 R2 RTM – Express with Management Tools so that you have access to the SQL Server Management Tools.

Step 3: Click on Continue to download the software.

If you want to register, click on Yes, or click on No if you don’t like to register before downloading. Once you have selected one of the options, click on the Next button.

Step 4: Select SQLEXPRWT_x64_ENU.exe if you have a 64-bit machine else, select SQLEXPRWT_x86_ENU.exe and click on next to continue with the download process.

Once you click on the Next button in the File save window, specify the folder where you want to save the software and continue downloading the software.

Installing the software

Step 1. Double click the downloaded File (SQLEXPRWT_x86_ENU.exeor Select SQLEXPRWT_x64_ENU.exe ) to start installing the database.

Step 2. Click on Continue

Step 3. Select New installation or add features to an existing installation.

Step 4. Click on I accept the license terms and then click on next.

Step 5. Click OK

Step 6. Click next

Step 7. Enter Microsoft, for instance, name and click next.

Step 8. Click Next.

Step 9. Select the Windows authentication mode.

Step 10: To add a user to the database, follow the steps below: (Optional)

select Add user. In the “Select Users, Computers or Groups” window, click on the Location button.

In the Locations window, select “Student Account” and click OK

You should see the Student account in the “From this location:” field. Click OK when done.

Click on the Advanced button.

Type “student” in the Name field and click on Find Now. You should see the Student User in the search result sub-window. Select the student User and click on the OK button.

You should now see the Student User in the Database Engine Configuration. Click next.

Click Next

Click on the close button

Step 11. Click OK and restart the computer to complete the SQL Server Setup process.

Step 12. Close the window.

Installing Sample Database

1. Download and install the sample SQL database for AdventureWorks (AdventureWorks2008R2_SR1.exe) 

2. Click on “AdventureWorks2008R2_data File” to download the database.

3. Move the AdventureWorks2008R2_Data.MDF and place it in the SQL Server data folder (For example C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.Microsoft\MSSQL\DATA\)

Note: You may have to update the location-based where your database was installed or if you assigned an instance name other than Microsoft.

4. Start SQL Server Management Studio by going to the windows start button, selecting Microsoft SQL Server 2008 R2, and then selecting SQL Server Management Studio (SSMS). This will open up the SSMS application used for managing the databases.

5. Select the word databases in the left panel and click on the new query button under the menu. This will create a blank work area on the right board.

6. In the SQL work area, execute the following T-SQL:

CREATE DATABASE AdventureWorks2008R2 ON (FILENAME=‘C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.Microsoft\MSSQL\DATA\AdventureWorks2008R2_Data.mdf’)FORATTACH_REBUILD_LOG;

Note: You may have to update the location-based where your database was installed or if you assigned an instance name other than Microsoft.

7. Select the word Databases in the left panel and right-click.

8. Select on Refresh option in the dropdown menu. After refreshing the window, You should now see the AdeventureWorks2008R2 database on the left panel.

Congratulations, you now have your sample database to work with!!

Vazi Okhandiar, Microsoft Certified Trainer (MCT)
NR Computer Learning Center
1835 W. Orangewood, #200
Orange, CA 92868