Hi,
I'd like to restore a sql database using OSQL but seem to be running into a few problems:
The sql database was originally backed up on a different machine the MDF files were located in a different location and the Database name was different.
Backed up From:
Database Name: Experts
Database Path: c:\Program Files\Experts Directory\Experts_Data.MDF
Database Path: c:\Program Files\Experts Directory\Experts_Log.LDF
Backup FIle: C:\Backup\Experts.BAK
Restore To:
Database Name: Exchange
Database Path: C:\Program Files\Exchange Directory\Exchange_Data.MDF
Database Path: C:\Program Files\Exchange Directory\Exchange_Log.LDF
Restore from: C:\Backup\Experts.BAK
I am using the following command but am running into problems:
osql -SDBServer -E -Q " RESTORE DATABASE Experts FROM DISK = 'C:\Backup\Expert.Bak' WITH MOVE 'C:\Program Files\Experts Directory\Experts_data.mdf' TO 'C:\Program Files\Exchange Directory\Exchange_Data.mdf', MOVE 'C:\Program Files\Experts Directory\Experts_log.ldf' TO 'C:\Program Files\Exchange Directory\Exchange_log.ldf' "
I did manage to restore the database using a graphical interface in enterprise manager.
Any help would be gratefully appreciated.
Many Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.