[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Importing Bak file into Sql Express

Posted on 2007-10-12
3
Medium Priority
?
2,093 Views
Last Modified: 2008-01-09
Hi I am having problems importing a backup file of a MS Sql database into Sql express.

I do the following query

RESTORE DATABASE db168338286 FROM DISK='C:\sitebook\oct8bkup.bak'
WITH MOVE 'Data_File' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db168338286.mdf',
MOVE 'Log_File' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db168338286_log.LDF'

i then get the error

Msg 3234, Level 16, State 2, Line 1
Logical file 'Data_File' is not part of database 'db168338286'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

when i restore filelist as below

RESTORE FILELISTONLY FROM DISK = 'C:\sitebook\oct8bkup.bak'

I get

db168338286      e:\mssql2000\MSSQL\data\db168338286.mdf      D      
db168338286_log      e:\mssql2000\MSSQL\data\db168338286_log.LDF      

I am trying to import the database to my laptop so i have a portable version of a web app i'm developing.  I should have mentioned that the backed up database is on the web.

Not sure if its worth noting, but my laptop doesn't have an E;\ only C:\

Please Help.

Thanks      
0
Comment
Question by:andrewdickie
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Yveau earned 2000 total points
ID: 20069175
So you should do:

RESTORE DATABASE db168338286 FROM DISK='C:\sitebook\oct8bkup.bak'
WITH MOVE 'db168338286' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db168338286.mdf',
MOVE 'db168338286_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db168338286_log.LDF'

The 'Data_file' and 'Log_file' are not the actual logical file names ...

Hope this helps ... (actually I'm pretty sure it will)

0
 

Author Comment

by:andrewdickie
ID: 20070454
Excellent Response, now when i look at, i think i'm such a dummy.  Cheers for your help.
0
 
LVL 18

Expert Comment

by:Yveau
ID: 20070601
Glad I could be of any help and thanks for the grade !
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question