Answers

Oct 10, 2006 - 08:18 AM
Well, I figured out how to do it:
The command prompt is run like this:
"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\OSQL.EXE" -E
Then write these lines to restore the database:
restore database mydbname from DISK = 'C:\xxx\xxx\xxx' with move 'database_Data' to 'C:\Database\xxx\database_Data.mdf', move 'database_Log' to 'C:\Database\xxx\database_Log.LDF'
go
It was the "WITH MOVE" that gave me problems. If you're restoring on another machine that doesn't have the exact same directory structure, then you need to add that.
The command prompt is run like this:
"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\OSQL.EXE" -E
Then write these lines to restore the database:
restore database mydbname from DISK = 'C:\xxx\xxx\xxx' with move 'database_Data' to 'C:\Database\xxx\database_Data.mdf', move 'database_Log' to 'C:\Database\xxx\database_Log.LDF'
go
It was the "WITH MOVE" that gave me problems. If you're restoring on another machine that doesn't have the exact same directory structure, then you need to add that.

May 21, 2014 - 04:46 AM
If you are accidentally lost and corrupted your SQL database from SQL server. You can try RecoveryFix for SQL database recovery software to recover your all lost SQL database. You can download this tool from here: http://www.mdf.repairsqlserver.net
For more inquiry read this post: http://diskdatarecovery.jimdo.com/2013/07/23/how-to-restore-lost-data-on-server
-while-running-sql-server
For more inquiry read this post: http://diskdatarecovery.jimdo.com/2013/07/23/how-to-restore-lost-data-on-server
-while-running-sql-server

Nov 19, 2014 - 11:03 AM
This will only work if the SQL Server was stopped when you copied the MDF file from the old SQL Server. If you copied the file while the SQL Server was running this file probably will not attach either and you will need to get a valid backup of the database. Download help tool for sql database - SQL Server Restore Toolbox. http://www.sqlserver.restoretools.com/ You can read up more on SQL Server here. http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/498-crea
ting-a-new-database-using-an-mdf-file?_=1416149856104
ting-a-new-database-using-an-mdf-file?_=1416149856104
Add New Comment