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.
Author |
Topic |
manjeet_kaur81
Starting Member
4 Posts |
Posted - 2005-10-07 : 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 & RegardsManjeet Mulchandani |
|
bakerjon
Posting Yak Master
145 Posts |
Posted - 2005-10-07 : 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 questionsJon-Like a kidney stone, this too shall pass. |
|
|
manjeet_kaur81
Starting Member
4 Posts |
Posted - 2005-10-07 : 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?ThanksManjeet |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-07 : 09:58:35
|
Restore the backup into a newdatabase and merge the data into the main one?INSERT INTO MainDatabase.dbo.MyTableSELECT * FROM RestoredDatabase.dbo.MyTableobviously 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 databasesCREATE VIEW dbo.MyTableASSELECT *FROM MainDatabase.dbo.MyTableUNIONSELECT * FROM RestoredDatabase.dbo.MyTableKristen |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-07 : 10:05:13
|
Kris, you told what I thought MadhivananFailing to plan is Planning to fail |
|
|
|
|
|
|
|