| Author |
Topic  |
|
|
manjeet_kaur81
Starting Member
India
4 Posts |
Posted - 10/07/2005 : 09:03:56
|
Hi,
I have seperated the database of last month and keep it in backup. Now i want to put back the database into current database, from which I have seperated it. Could any even tell em , is it possible,if yes, then how?
Thanks & Regards
Manjeet Mulchandani |
|
|
bakerjon
Posting Yak Master
USA
145 Posts |
Posted - 10/07/2005 : 09:29:07
|
I think we need more information. Do you want to overwrite the data in the existing database with the data from last month, or do you want to integrate the data with what is in the existing database?
If you are looking to overwrite the existing database, doing a restore from backup will likely do the trick. RESTORE DATABASE x FROM DISK = 'somepathwithbackupfile'
If you are looking to mix all the data together, that could be a little more interesting, and leads to a whole new set of questions
Jon -Like a kidney stone, this too shall pass.
|
 |
|
|
manjeet_kaur81
Starting Member
India
4 Posts |
Posted - 10/07/2005 : 09:33:55
|
yes, I want both months data into database. I know, about overwritng the data using restore. But i want to retain the current data ( in database) as well. Is it possible?
Thanks
Manjeet |
 |
|
|
Kristen
Test
United Kingdom
22191 Posts |
Posted - 10/07/2005 : 09:58:35
|
Restore the backup into a newdatabase and merge the data into the main one?
INSERT INTO MainDatabase.dbo.MyTable SELECT * FROM RestoredDatabase.dbo.MyTable
obviously you will have to watch out for any data that already exists.
Alternatively you could make some views (in a third database) - this would probably be OK [performance-wise] if you just wanted to make a few reports, but keep the old and new data segregated in different databases
CREATE VIEW dbo.MyTable AS SELECT * FROM MainDatabase.dbo.MyTable UNION SELECT * FROM RestoredDatabase.dbo.MyTable
Kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 10/07/2005 : 10:05:13
|
Kris, you told what I thought 
Madhivanan
Failing to plan is Planning to fail |
 |
|
| |
Topic  |
|