Export (0) Print
Expand All

Reinstalling Sample Databases from Script

SQL Server 2005

If you have made changes to a sample database and want to return to the original schema, you can reinstall the database by running the appropriate installation script from Microsoft SQL Server Management Studio Query Editor. The installation script removes the existing sample database, re-creates the database objects, and populates the tables.

Alternatively, you can download the AdventureWorks database at the SQL Server Developer Web site.

ms143758.note(en-US,SQL.90).gifNote:
These procedures do not apply to SQL Server 2005 Express Edition or SQL Server Compact Edition. To download AdventureWorks for these editions, see Installing Sample Databases for Express Editions.

The following procedures describe how to reinstall the AdventureWorks database and the AdventureWorksDW data warehouse.

  1. On the Management Studio toolbar, click File, point to Open and then click File.

  2. Browse to the file instawdb.sql and click Open. The default location of this file is C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks OLTP.

  3. Before running the script, locate the statement SET @data_path = @sql_path + 'AWDB\'; in the script and change the statement to point to the location of the instawdb.sql script. For example, SET @data_path = 'C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks OLTP\';.

  4. Execute the script.

  1. On the Management Studio tool bar, click File, point to Open and then click File.

  2. Browse to the file instawdwdb.sql and click Open. The default location of this file is C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks Data Warehouse.

  3. Before running the script, locate the statement SET @data_path = @sql_path + 'awdwdb\'; in the script and change the statement to point to the location of the instawdwdb.sql script. For example, SET @data_path = 'C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks Data Warehouse\';.

  4. Execute the script.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft