Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please help me with the code

I want to prevent the new and old data respectively. in the abouve code it is removing the new data which is entered after backup made of the data means(old data backup). restore sql database without overwrite existing database. Please help me with the code

This is my code

"Restore database from disk ='d:\demo' with file = 1, nounload, stats = 10"
Posted
Updated 15-Mar-14 9:26am
v3
Comments
OriginalGriff 15-Mar-14 9:47am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
NIRMAL90 15-Mar-14 10:42am    
Thnkxx for the Advice
OriginalGriff 15-Mar-14 10:51am    
You're welcome.
NIRMAL90 15-Mar-14 10:46am    
I use this query "Restore database from disk ='d:\demo' with file = 1, nounload, stats = 10"
to restore the database but the new data is been erase (backup file is old once). how to prevent the new + old data

restore sql database without overwrite existing database

1 solution

To "preserve" your old data you need to restore your backup to a new database keeping your old one and then manually merge your tables.

There are tools that can help you like http://www.red-gate.com/products/SQL%5FData%5FCompare/index.htm[^]

Read this also : http://stackoverflow.com/questions/909541/how-to-merge-two-databases-in-sql-server[^]
 
Share this answer
 
Comments
Aarti Meswania 16-Mar-14 4:14am    
5+! :)
Mehdi Gholam 16-Mar-14 4:18am    
Cheers Aarti!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900