importing adventure works

guys,

i downlaoded the adventuresworks database from the microsoft website. I extracted it and i noticed it is a .bak file.

https://msftdbprodsamples.codeplex.com/releases/view/125550

How can i get this .bak into my express sql server 2014 cause import isnt working?

thanks for the help.

July 26th, 2015 1:04pm

Hi enlil,

The .bak are backup file, you can restore them using script or by ssms(sql server management studio).

for script use these command:

RESTORE DATABASE newdatabase
FROM DISK = 'c:\<dirlocation>\filename.bak'

For ssms, please follow link => http://social.technet.microsoft.com/wiki/contents/articles/7654.how-to-restore-a-database-backup-using-bak-file-in-ms-sql-server-2012.aspx

Here is MSDN link for RESTORE COMMAND:

     1.) https://msdn.microsoft.com/en-us/library/ms186858.aspx

     2.) https://msdn.microsoft.com/en-us/library/ms177429(v=sql.120).aspx

Free Windows Admin Tool Kit Click here and download it now
July 26th, 2015 1:16pm

 

Install Adventure Works 2014 OLTP database from a backup

The Adventure Works 2014 OLTP database can be installed by restoring a database backup.

  1. Download the Adventure Works 2014 Full Database Backup.zip .

  2. From File Download, click Save. Once it is saved,open the folder.

  3. Extract the AdventureWorks2014.bak file to a location on your local server.

Note:The default 64-bit path is C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup. Use C:\Program Files (x86)\... for 32-bit SQL Server 2014

  1. From SQL Server Management Studio connect to the 2014 instance.

  2. On the Standard toolbar, click the New Query button.

  3. Execute the following code in the query window:

Note:The file paths in the scripts are the default paths. You may need to update the paths in the scripts to match your environment.

USE [master]

RESTORE DATABASE AdventureWorks2014

  FROM disk='C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup\AdventureWorks2014.bak'

  WITH MOVE 'AdventureWorks2014_data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\AdventureWorks2014.mdf',

          MOVE 'AdventureWorks2014_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\AdventureWorks2014.ldf',

  REPLACE

As an alternative to steps 5 and 6, you can restore the database using the SQL Server Management Studio user interface. For more detailed information, see Restore a Database Backup (SQL Server Management Studio).

   

July 26th, 2015 1:42pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics