How add sample AdventureWorks2012 database for SQL Server 2012?
Go the http://msftdbprodsamples.codeplex.com/ website and click on icon with SQL Server 2012 DW
.
You see list of links. Choose link AdventureWorks2012 Data File
.
It will be to download AdventureWorks2012_Data.mdf
file.
The mdf files in SQL Server are in Data
folder. In my PC it is path:
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA
It is place for all SQL Server databases. So if You downloaded this file, copy it in this folder.
If You have problem with copy i, with warning information, resolving it may be to configure SQL Server.
Choose from menu Start
in Windows 7 Start->SQL Server 2012->Configuration Tools->SQL Server Configuration Manager
.
You see configuration window. In it select on the left SQL Server Services
. In another section right click the SQL Server MSSQLSERVER
and from pop-up menu select Stop
.
The server will be stopping.
In this moment You may paste your database file. After this action, You may start Your SQL Server. Right click the SQL Server MSSQLSERVER
and from pop-up menu select Start
.
After paste mdf file, launch the SQL Server Management Studio
. Extends Database node. You don’t see your copied database AdventureWorks2012_Data.mdf
.
Next step is attach this database. So right click the Database
node and from pop-up menu choose Attach
.
The Attach
window displays.
Click in it the Add
button. In Locate Database File
window You see all mdf files of databases in your SQL Server. Select your pasted database.
And click the OK
button. In Attach Database
window select row with ldf
file, if You don’t copy this file into Data folder in SQL Server. Select this row and click the Remove
button.
Go to next step clicking the OK
button.
The row with ldf
is removed so You may click the OK
button. In Object Explorer
window You see in Databases
node AdventureWorks2012
database.