Setting up SQL SERVER 2008 R2 Database

To install and setup 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 the Microsoft website with access to download free SQL Server 2008 R2 database:

http://www.microsoft.com/en-us/download/search.aspx?q=sql+server+2008+r2

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.

Click on Yes, if you want to register or click on No is you don’t want 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 Next button, in the File save window, specify the folder where you want to save the software and continue with the downloading the software.

Installing the software

Step 1. Double click the downloaded file (SQLEXPRWT_x86_ENU.exe or 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 MTA for instance name and click next.

Step 8. Click Next.

Step 9. Select 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 Location button.

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

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

Click on 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 OK button.

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

Click Next

Click on close button

Step 11. Click OK and restart the computer to complete 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) located at http://msftdbprodsamples.codeplex.com/releases/view/59211

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.MTA\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 MTA.

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

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

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

CREATEDATABASE AdventureWorks2008R2 ON (FILENAME=‘C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.MTA\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 MTA.

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 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
www.nrclc.com
714-505-3475