Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Merge a .bak into an online DB

Author  Topic 

adonnell
Starting Member

4 Posts

Posted - 2011-06-10 : 13:09:10
SQL Server 2005 v9.00.3042.00

I have a database with 6 tables in it. It was running on a server that failed so the backup computer took over and populated that DB during the time the backup server was running. The original computer came back online and the backup was shutdown.

How do I move all the data from the backup server DB to the original server DB for the timeframe when the backup was running? I want to merge the online DB with the backup file from the backup server DB.

I created backup files for the DB on the backup server and moved them to the online server. Is it a simple restoration with leaving the "Overwrite the existing database" option unchecked? Need to be sure before I do it.

Thanks for any help!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-10 : 14:29:59
Restore it to a new database name, and then you can merge via T-SQL statements.

You can not just restore over your database as it does not do any merging, no merging whatsoever is possible with just backup/restore.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

adonnell
Starting Member

4 Posts

Posted - 2011-06-10 : 14:34:00
thank you very much for your reply. It is working.

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-06-10 : 16:38:33
Get a copy of RedGate's SQLDataCompare. Let's you compare and sync a database with a backup.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -