On SQLServer 2005 Standard Edition Service Pack 2 - we have a routine that backs up databases onto a dedicated drive. It is a full backup to disk. This routine does not drop the database
BACKUP DATABASE MY_DB TO DISK = 'I:\backups\jvTest20081127.BAK' WITH NOFORMAT,COPY_ONLY, INIT, NAME = MY_DB , SKIP, NOREWIND, NOUNLOAD, STATS = 10;
A couple of weeks later , I needed one of the databases and attempted a standard RESTORE DATABASE
but without the WITH REPLACE parameter.
RESTORE DATABASE MY_DB FROM DISK = 'I:\backups\jvTest20081127.BAK'
An error was encountered : Error 3154: The backup set holds a backup of a database other than the existing database
The error occurs because I was trying to restore the database on another existing active database.
The solution is :
RESTORE DATABASE myDB FROM DISK = N'I:\backups\jvTest20081127.BAK' WITH REPLACE