Showing posts with label original. Show all posts
Showing posts with label original. Show all posts

Monday, March 26, 2012

restore database without mdf or ldf file

Hi,

Is it possible to restore a database with only a .bak file??
When I try to restore the system comes up with 2 paths where probably the original .mdf and .ldf files existed, but on my system they don't exist. How can I avoid this problem? (it's not possible to get the ldf and mdf files anymore...)

Grtz
Carloscreate a new database like so...

CREATE DATABASE MyDATABASE

use sp_helpdb to get the filenames for the mdf and the ldf you just created

sp_helpdb MYDATABASE

use RESTORE FILELISTONLY to get the logical filenames of the mdf and ldf in the backup file like

RESTORE FILELISTONLY
FROM DISK = 'C:\Mybackup.bak'

Use RESTORE with MOVE like so

RESTORE DATABASE MyDatabase
FROM DISK = 'C:\Mybackup.bak'
WITH REPLACE,RECOVERY,
MOVE 'Logicalfile_Data' TO 'D:\Microsoft SQL Server\MSSQL\data\physicalfile.mdf' , MOVE 'Logicalfile_Log' TO 'D:\Microsoft SQL Server\MSSQL\data\physicalfile_log.LDF'|||Its quite possible to restore the db even if the underlying db is not preset. U need to provide the correct path where u want the mdf and ldf files to be created.|||Thnx for the quick reply!

Friday, March 9, 2012

restore back up from sql 2005 beta 2 to sql 2005 original

hai,

When i try to restore the backup which has been taken in sql2005 beta 2 and restore it in sql2005 original it is displaying the following error message.

System.Data.SqlClient.SqlError: The database was backed up on a server running version 9.00.0852. That version is incompatible with this server, which is running version 9.00.1399. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)

please let me know how i can restore the back.

I am moving this to the SQL Server Database Engine forum.|||You may have to script out the schema and then copy the data from the Beta2 database to the RTM (1399) version database. You might be able to use Visual Studio for Database Professionals, aka "DataDude" to do this.|||Your only other alternative is to restore from sql 2005 beta 2 to sql 2005 beta 3 and then from sql 2005 beta 3 to sql 2005 RTM