Download Adventureworks Database For Sql Server 2012

-->

The sample database AdventureWorks plays an important role while performing test operations and learning about new features. So after the installation of SQL Server 2012 and searching for the sample database AdventureWorks I found that it contains only the 'mdf' file to download. This tip gives you. 2012-8-23  Finding the Correct Version of the AdventureWorks SQL Server Sample Database. Hi Lori, yes, you can attach or restore the AdventureWorks 2012 database in a SQL Server 2014 instance. I just tested it out with the AdventureWorks2012-Full Database Backup.zip.

适用对象:SQL ServerAzure SQL 数据库Azure SQL 数据仓库并行数据仓库APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse

AdventureWorks 下载链接和安装说明。AdventureWorks download links and installation instructions.

先决条件Prerequisites

  • SQL Server或Azure SQL 数据库。SQL Server or Azure SQL Database.对于该示例的完整版本,使用 SQL Server 评估/开发人员/企业版。For the Full version of the sample, use SQL Server Evaluation/Developer/Enterprise Edition.
  • SQL Server Management Studio。SQL Server Management Studio.为获得最佳结果使用 2016 年 6 月发行版或更高版本。For the best results use the June 2016 release or later.

Github 链接Github links

OLTP 下载OLTP downloads

Download Adventureworks Database For Sql Server 2012

可在下面找到 AdventureWorks OLTP 版本的直接链接:Direct links to the OLTP versions of AdventureWorks can be found below:

Download Adventureworks Database For Sql Server 2012

数据仓库下载Data Warehouse downloads

直接链接到 AdventureWorks 的数据仓库版本可在下文:Direct links to the Data Warehouse versions of AdventureWorks can be found below:

创建脚本Creation scripts

以下脚本可用于创建整个 AdventureWorks 数据库中的,而不考虑版本。The below scripts can be used to create the entire AdventureWorks database, irrespective of version.

到 SQL Server 安装Install to SQL Server

还原备份Restore backup

请按照以下步骤来还原备份的数据库使用 SQL Server Management Studio。Follow the below steps to restore a backup of your database using SQL Server Management Studio.

Download Adventureworks Database For Sql Server 2012 Free

  1. 打开 SQL Server Management Studio 并连接到目标 SQL Server 实例。Open SQL Server Management Studio and connect to the target SQL Server instance.
  2. 右键单击数据库节点,然后选择Restore DatabaseRight-click on the Databases node, and select Restore Database.
  3. 选择设备,然后单击省略号 (...)Select Device and click the ellipses (...)
  4. 在对话框选择备份设备,单击添加,导航到的服务器的文件系统中的数据库备份,并选择的备份。In the dialog Select backup devices, click Add, navigate to the database backup in the filesystem of the server, and select the backup.单击“确定” 。Click OK.
  5. 如果需要更改数据的目标位置,并在日志文件,文件窗格。If needed, change the target location for the data and log files, in the Files pane.请注意,它将数据和日志文件的不同驱动器上的最佳做法。Note that it is best practice to place data and log files on different drives.
  6. 单击“确定” 。Click OK.这将启动数据库还原。This will initiate the database restore.完成后,必须安装 SQL Server 实例上的 AdventureWorks 数据库。After it completes, you will have the AdventureWorks database installed on your SQL Server instance.

有关还原 SQL Server 数据库的详细信息,请参阅使用 SSMS 将数据库备份还原。For more information on restoring a SQL Server database, see Restore a database backup using SSMS.

附加数据文件Attach a datafile

请按照以下步骤来将附加使用 SQL Server Management Studio 为数据库数据文件。Follow the below steps to attach the datafile for your database using SQL Server Management Studio.

  1. 打开 SQL Server Management Studio 并连接到目标 SQL Server 实例。Open SQL Server Management Studio and connect to the target SQL Server instance.
  2. 右键单击数据库节点,然后选择附加Right-click on the Databases node, and select Attach.
  3. 选择添加并导航到。你想要附加的 MDF 文件。Select Add and navigate to the .MDF file you want to attach.
  4. 选择该文件,然后单击确定Select the file and click OK.
    1. 您选择的数据库应显示在底部窗口中。The database you selected should be displayed in the bottom window.如果列出该文件为'未找到',选择省略号 (...) 旁边的文件名和更新的正确路径的路径。If the file is listed as 'not found', select the ellipses (...) next to the file name and update the path to the correct path.
    2. 如果只有数据文件 (.mdf),而不是日志文件 (.ldf),然后突出显示在底部窗口.ldf 并选择删除If you only have the data file (.mdf), and not the log file (.ldf), then highlight the .ldf in the bottom window and select Remove.这将创建新的日志文件。This will create a new log file.
  5. 选择确定可以附加的文件。Select OK to attach the file.附加文件后,必须安装 SQL Server 实例上的 AdventureWorks 数据库。After the file is attached, you will have the AdventureWorks database installed on your SQL Server instance.

有关附加数据库文件的详细信息,请参阅附加数据库。For more information on attaching database files, see Attach a database.

Download Adventureworks Database For Sql Server 2012 Windows 10

安装到 Azure SQL 数据库Install to Azure SQL Database

如果你还没有 SQL Server 在 Azure 中,导航到Azure 门户并创建新的 SQL 数据库。If you do not yet have a SQL Server in Azure, navigate to the Azure portal and create a new SQL Database.过程中创建数据库,将创建的服务器。In the process of create a database, you will create a server.记下的服务器。Make note of the server.请参阅本教程在几分钟内创建数据库。See this tutorial to create a database in minutes.

Download Adventureworksdw Database For Sql Server 2012

  1. 连接到 Azure 门户。Connect to your Azure portal.
  2. 选择创建资源在左上角的导航窗格中。Select Create a resource in the top left of the navigation pane.
  3. 选择数据库,然后选择SQL 数据库Select Databases and then select SQL Database.
  4. 填写必需的信息。Fill in the requested information.
  5. 在中选择源字段中,选择示例 (AdventureWorksLT) 最新的 AdventureWorksLT 备份将备份还原。In the Select Source field, select Sample (AdventureWorksLT) to restore a backup of the latest AdventureWorksLT backup.
  6. 选择创建创建新 SQL 数据库,这是在 AdventureWorksLT 数据库的已还原的副本。Select Create to create your new SQL Database, which is the restored copy of the AdventureWorksLT database.

Download Adventureworks Database For Sql Server 2012 Edition

另请参阅See also

Download Adventureworks Database For Sql Server 2012

SQL Server Management studio 教程Tutorials for SQL Server Management Studio
有关 SQL Server 数据库引擎教程Tutorials for SQL Server database engine