How to install sample database (AdventureWorks) in MSSQL 2008R2

As you know that SQL Server 2008 is not coming with inbuilt sample database so if we want to do practice or learn about it, we need to install it manually.

Download AdventureWorks 2008R2 SR1 from the following link.

http://msftdbprodsamples.codeplex.com/releases/view/55926

(If link has expired then go to http://www.codeplex.com/ and search for AdventureWorks 2008R2 SR1)

 

Save and copy this file to your SQL server, it should be around 83 mb size. Before running this executable there are some prerequisites which we need to finish.

Installation Prerequisites:-

  1. SQL server 2008 or 2008 R2 must be installed
  2. Need to install with account which has sysadmin privileges
  3. Full-text search should be installed and Full-text Filter Daemon Launcher Service should be running

–         To install Full-Text search, run SQL server setup

–         Select the “New SQL Server stand-alone installation or add features to an existing installation” installation option

–         At “Installation Type” page, select “Add features to an existing instance of SQL server 2008” select the instance name and click “Next”

–         At “Feature Selection” page, under the Instance Features/Database Engine Services” node, select the “Full-Text Search check box, click “Next” and finish the wizard.

After installing this feature, SQL Full-text Filter Daemon Launcher Service should be enabled. To enable this service follow these steps.

–         Click Start, point to All Programs, point to Microsoft SQL Server 2008, point to Configuration Tools, and then click SQL Server Configuration Manager.

–         In the left pane, click SQL Server Services.

–         In the list of services, right-click SQL Full-text Filter Daemon Launcher for the instance that you are configuring, and then click Properties.

–         Click the Service tab.

–         Next to Start Mode, click Disabled, and then click Automatic in the list that appears.

–         Click OK.

Right-click SQL Full-text Filter Daemon Launcher for the instance that you are configuring, and then click Start.

 

  1. Enabling FILESTREAM

 

–         On the Start menu, point to All Programs, point to Microsoft SQL Server 2008 R2, point to Configuration Tools, and then click SQL Server Configuration Manager.

–         In the list of services, right-click SQL Server Services, and then click Open.

–         In the SQL Server Configuration Manager snap-in, locate the instance of SQL Server on which you want to enable FILESTREAM.

–         Right-click the instance, and then click Properties.

–         In the SQL Server Properties dialog box, click the FILESTREAM tab.

–         Select the Enable FILESTREAM for Transact-SQL access check box.

–         If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.

–         If remote clients must access the FILESTREAM data that is stored on this share, select Allow remote clients to have streaming access to FILESTREAM data.

–         Click Apply.

–         In SQL Server Management Studio, click New Query to display the Query Editor.

–         In Query Editor, enter the following Transact-SQL code:

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

This will enable FILESTREAM for both Transact-SQL access and for file I/O streaming access. To enable FILESTREAM for Transact-SQL access only, issue the following statements:

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

–            Click Execute.

Note: By selecting proper option these prerequisites you can enable during SQL server new instance installation also.

After installing these prerequisites now you are ready to install AdventureWorks sample database. Make sure that you don’t have any other AW database installed if so then delete those with all .MDF and .LDF files.

Now run the AdventureWorks2008R2_SR1.exe file. It will start the setup wizard.

Select the proper instance and location where you want to install (default location is recommended). If you don’t want to install any sample database you can uncheck.

Click on “Install” to install the scrip and data files. If you will click on “Show Details” it will show the all steps/processes.

Once it will finish, open SSMS and you can see the AdventureWorks databases.

Your database is ready now.

  1. Leave a comment

Leave a comment