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.
Author |
Topic |
fabianus76
Posting Yak Master
191 Posts |
Posted - 2005-09-05 : 12:02:47
|
Hallo!I would like to know how I may import a .bak file (produced by SQL-Server 2005) into SQLExpress. Thank you very much for any help !Regards, Fabian |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-09-05 : 12:38:33
|
You should be able to restore it using the RESTORE command. |
|
|
fabianus76
Posting Yak Master
191 Posts |
Posted - 2005-09-09 : 07:17:16
|
>>You should be able to restore it using the RESTORE command.Hallo robvolk, thank you for your reply. I do not know where and how to use the RESTORE command. I would be very happy if you could tell me where this has to be executed and how I tell the command where is located my file to be restored. Regards, Fabian |
|
|
robvolk
Most Valuable Yak
15732 Posts |
|
fabianus76
Posting Yak Master
191 Posts |
Posted - 2005-09-09 : 07:27:35
|
When I execute this : RESTORE DATABASE MealManager FILE = 'D:\savedata\SQL-Server\MealManager.bak'I get this error : .Net SqlClient Data Provider: Msg 3118, Level 16, State 1, Line 1The database "MealManager" does not exist. RESTORE can only create a database when restoring either a full backup or a file backup of the primary file..Net SqlClient Data Provider: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.Any idea what I could change?Regards, Fabian |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-09-09 : 07:51:18
|
If you are creating a new database, you must specify where the data and log files are to be placed. Your syntax was also off a little bit:RESTORE DATABASE MealManager FROM DISK='D:\savedata\SQL-Server\MealManager.bak' WITH MOVE 'Data_File' TO 'e:\MealManager_Data.mdf',MOVE 'Log_File' TO 'F:\MealManager_Log.ldf'If you need a list of the logical and physical file names in the backup file:RESTORE FILELISTONLY FROM DISK= 'D:\savedata\SQL-Server\MealManager.bak' |
|
|
fabianus76
Posting Yak Master
191 Posts |
Posted - 2005-09-09 : 07:54:34
|
Got it !RESTORE DATABASE MealManager FROM DISK = 'D:\savedata\SQL-Server\MealManager.bak'Thank you very much!Regards, Fabian |
|
|
|
|
|
|
|