SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 database backup and restore
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vpcnk
Starting Member

India
2 Posts

Posted - 04/10/2014 :  00:25:40  Show Profile  Reply with Quote
I have two databases on the same mssql instance - testdb and mirrordb.

testdb has some data. mirrordb has no data.

I want to copy the data of testdb into mirrordb.

so I want to backup testdb and restore mirrordb from the backup file of testdb.

I tried :

BACKUP DATABASE "testdb" TO DISK='c:\mssql\backup\testdb.bkup' WITH NOFORMAT,INIT,STATS=10
restore DATABASE "mirrordb" from DISK='c:\mssql\backup\testdb.bkup' WITH recovery,STATS=10

but get the error :



Msg 3154, Level 16, State 4, Line 1

The backup set holds a backup of a database other than the existing 'mirrordb' database.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.



can somebody tell me how to do this right?

appreciate the feedback.

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1754 Posts

Posted - 04/17/2014 :  19:38:59  Show Profile  Reply with Quote
restore DATABASE "mirrordb" from DISK='c:\mssql\backup\testdb.bkup' WITH recovery,REPLACE,STATS=10



===============================================================================
“Everyone wants a better life: very few of us want to be better people.”
-Alain de Botton
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000