Restoring SQL by Combining Tables from Backups - URGENT

We had an issue today when someone noticed that two tables in our SQL DB were missing (the data was missing).  We have a good backup from 10 hours earlier that had the table and data but want to be able to backup today's activities then see if we can combine the DB's to meld together the combined since it was hours before someone noticed it.

In practice can this be done?
iNetSystemAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Scott PletcherConnect With a Mentor Senior DBACommented:
>> If this is something that's been done before can you outline how to do it? <<


You can INSERT (or UPDATE) directly from one db to the other.  Like this:

INSERT INTO db_name.dbo.tablename1 ( ... )
SELECT ...
FROM db_name_restored.dbo.tablename1
WHERE
    ...


You can write/gen your own queries to sync the data.

OR: you can use MS's free program "tablediff.exe" to find data differences between tables, and gen the code to sync them; this is a line-command utility that takes getting used to but actually works pretty well once you do -- and, again, it's free.

OR: you can look into RedGate or some other vendor's data comparison software that is more powerful, has a GUI, extra options, etc..
0
 
liijaCommented:
There's no partial restore in SQL Server. Restore to another database and copy the data to production db a way or another.
0
 
iNetSystemAuthor Commented:
I was thinking of preventing anyone from using it for a couple of hours at which time I would:

1) Restore the DB with the majority of the records to a new DB
2) Backup today's DB
3) Find the Tables that don't have today's data and import in the data from today in the same tables into the newly created DB

If this is something that's been done before can you outline how to do it?
0
 
liijaCommented:
Basic things for dba, start with backup and restore. I don't have time today help you any further today, hope someone else has...
0
 
Ramesh Babu VavillaConnect With a Mentor Commented:
easy step to complete this situation script the 2 tables with data option and execute the script on the destination server


or
if its a huge database you can use BCP
ot
use t
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.