加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql-server-2008 – 在哪里下载AdventureWorks2008.msi?

发布时间:2020-12-12 06:46:59 所属栏目:MsSql教程 来源:网络整理
导读:我想安装AdventureWorks2008(我只是安装SQL Server 2008 R2 Express). 每次我从CodePlex下载推荐的版本时,我得到的只是一个AdventureWorks2008.mdf文件.我不仅无法从SQL Server Management Studio附加文件,而且无法将文件直接复制/粘贴到数据库中. 我在几个地
我想安装AdventureWorks2008(我只是安装SQL Server 2008 R2 Express).

每次我从CodePlex下载推荐的版本时,我得到的只是一个AdventureWorks2008.mdf文件.我不仅无法从SQL Server Management Studio附加文件,而且无法将文件直接复制/粘贴到数据库中.

我在几个地方读过我需要使用AdventureWorks2008.msi,但我找不到下载它的位置.

我只是想不通如何安装AdventureWorks2008

谢谢你的帮助

解决方法

冒险工作没有.msi文件,即使你会在过时的文档和书籍中找到它.您并不是唯一一个发现这种混淆的人 – 似乎每次我需要安装这些数据库时,Microsoft为安装这些数据库提供的网站,文件和步骤都会发生变化.

您需要创建数据库并附加.mdf文件,该文件是说明中提到的“数据文件”. (.mdf =主数据文件,.ldf =日志文件,.ndf =辅助数据文件)

要附加文件,您需要确保仔细按照此处的步骤操作:http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme-en-us.aspx#Readme_for_Adventure_Works_Sample_Databases

2008R2的说明:

To install AdventureWorks2008R2 OLTP database

  1. Download the AdventureWorks2008R2 Data File.

  2. From File Download,click Save and browse to a location on your local
    server.

  3. From SQL Server Management Studio,execute the following code:

Case-insensitive Database

CREATE DATABASE AdventureWorks2008R2 
ON (FILENAME = '{drive}:{file path}AdventureWorks2008R2_Data.mdf') 
FOR ATTACH_REBUILD_LOG;

As an alternative to step 3,you can attach the database using the SQL
Server Management Studio user interface. For more detailed
information,see 07001.

Note: You must remove the log file from the list of files to attach.
This will cause the operation to rebuild the log.

Aaron Bertrand的头痛保护技巧:

You should place the mdf file in your normal data folder – SQL Server
will already have the proper permissions. You can get this path using

SELECT TOP(1)physical_name FROM master.sys.database_files;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读