Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Restore database

Author  Topic 

Jack121
Starting Member

14 Posts

Posted - 2007-11-01 : 19:02:22
Hello, is it possible to restore a SQL server 2005 database onto the express version..I have a backup file that was created on SQL 2005, but I would like to restore it on my laptop which has SQL server express..I have tried

RESTORE DATABASE DBName
FROM DISK = 'C:\Test.BAK'
WITH REPLACE, MOVE 'Test_Data' TO 'C:\MSSQL\DATA\DBName_Data.MDF',
MOVE 'Test_Log' TO 'C:\MSSQL\DATA\Test_Log.LDF'

but i get lots of error messages


Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\Test1.mdf" failed with the operating system error 3(error not found).
Msg 3156, Level 16, State 3, Line 1
File 'Test1' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\Test1.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\Test1_log.ldf" failed with the operating system error 3(error not found).
Msg 3156, Level 16, State 3, Line 1
File 'Test1_log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\DATA\Test1_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


..can someone help with the syntax..please..thanks

Jack

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-01 : 19:09:43
I think that's possible. I've never used Express though.

Have you verified that Test_Data and Test_Log are the correct logical names for this database? From the errors, looks like they may be named Test1 and Test1_log.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-11-01 : 19:11:05
See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example
Go to Top of Page
   

- Advertisement -