zoukankan      html  css  js  c++  java
  • Microsoft SQL Server Product Samples:Database

    从SQL Server 2005 之后示例数据都为AdventureWorks,需要的通过codeplex网站下载。这样设计的目的应该在于是生产库行不必要的用户以及权限分配。

    从以下网址访问http://msftdbprodsamples.codeplex.com/

    除了版本上的区分外,还有OLTP与DW的区分,选择相对应的版本进行下载。一般来说向后兼容,所以就以AdventureWorks2012 作为范例。

    数据的下载有多种方式例如直接下载mdf文件,或者使用脚本进行安装或使用备份进行还原的方式。省时省力的还是下载mdf方式进行直接Attach。

    To install AdventureWorks2012 OLTP database

    1. Download the AdventureWorks2012 Data File .
    2. From the License Agreement, click I Agree.
    3. From File Download, click Save and browse to a location on your local server.
    4. From SQL Server Management Studio, execute the following code: 路径名请自行更改

    USE [master]

    GO

    CREATE DATABASE [AdventureWorks2012] ON

    ( FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL11.MSSQLSERVERMSSQLDATAAdventureWorks2012_Data.mdf' )

    FOR ATTACH

    GO

     

     

    detach 脚本

    USE [master]

    GO

    EXEC master.dbo.sp_detach_db @dbname = N'AdventureWorks2012'

    GO

    使用图形界面attach 需要注意将默认的Log文件去除

     

     

     

     

    微软示例数据库帮助文档

    http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme.aspx#Readme_for_Adventure_Workus_Sample_Databases

    示例数据库下载地址

    http://msftdbprodsamples.codeplex.com/

  • 相关阅读:
    多线程刷题
    Spring Security的<form>表单的一些细节以及configure(HttpSecurity http)的配置
    Spring Security配置loginPage后,默认的表单登录请求接口也是这个
    一个留了两个星期的bug,基础忘光了
    连接数据库
    反射--笔记(第一篇)
    让图片左右移动
    Java注解
    HTTP协议
    使用servlet连接数据库删除数据
  • 原文地址:https://www.cnblogs.com/cnLing/p/3339035.html
Copyright © 2011-2022 走看看