-1

I have a SQL-Server database that crashed while I was away on vacation. All info from 5/2/13 is missing from our current database because my replacement implemented a back-up of the database from 5/1/13. So, My current database has all information up to 5/1/13 (missing data from 5/2/13) and 5/3/13 on. I have access to, the database with all info from 5/2/13 Is there a way to merge this info?

ypercubeTM
99.7k13 gold badges217 silver badges306 bronze badges
asked May 13, 2013 at 15:32
3
  • 2
    Did you know that "5/2" has a different meaning in some parts of the world? Commented May 13, 2013 at 15:37
  • 2
    Which RDBMS, for starters? Commented May 13, 2013 at 16:06
  • Do you possibly mean "merge the transactions" rather than "merge the databases"? If so, whatever solution is put forward will be subject to the possiblity that some transactions that were allowed in the actual scenario would have been disallowed if the the 5/2 transactions had been applied before the 5/3 transactions were attempted. Commented May 14, 2013 at 10:09

1 Answer 1

2

You'll have to manually query for the rows and copy then in using either T-SQL or SSIS. There's no way to take the two databases and have SQL Server just merge them into one database.

If you are using identity vales on tables you'll need to be careful of duplicate values and assign new values to the rows that you are inserting. If you have other tables which rely on those values those tables will need to be updated with the new values as they are written to the production database.

This isn't an easy thing to do, but it is doable.

answered May 13, 2013 at 15:37
3
  • 1
    Assuming SQL Server? Commented May 13, 2013 at 16:07
  • Yep, I'm assuming SQL Server as it's tagged SQL Server and says SQL Server in the question. Commented May 13, 2013 at 17:11
  • 1
    Before it got edited.... Sigh. Commented May 13, 2013 at 17:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.