January 11, 2006 at 10:42 am
I use sql to restore a db:
use master
restore database macor
from disk = 'E:\docs\dminsite+tech\db_dump_macor\macor_db_20051231.bak
with move 'macor_data' to 'e:\dbs\macor\macord_data.mdf',
move 'macor_log' to 'e:\dbs\macor\macor_log.ldf'
It gave me error 'the backup set holds a backup of a database other than existing 'macor' database. Restore database is terminating abnomrally'
I know when the EM, we can check the option 'Override the existing database'. What is that flag or command in SQL restore.
Please advise.
Thanks
Minh
January 11, 2006 at 12:26 pm
Hello Minh,
From BOL:
REPLACE
Specifies that SQL Server should create the specified database and its related files even if another database already exists with the same name. In such a case, the existing database is deleted. When the REPLACE option is not specified, a safety check occurs (which prevents overwriting a different database by accident). The safety check ensures that the RESTORE DATABASE statement will not restore the database to the current server if:
REPLACE also allows RESTORE to overwrite an existing file which cannot be verified as belonging to the database being restored. Normally, RESTORE will refuse to overwrite pre-existing files.
Lucky
January 11, 2006 at 5:27 pm
thanks much. I found that one too.
Minh
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply