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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Can i put back the data into database?

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 & Regards

Manjeet 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 questions


Jon
-Like a kidney stone, this too shall pass.
Go to Top of Page

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?

Thanks

Manjeet
Go to Top of Page

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.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
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-07 : 10:05:13
Kris, you told what I thought

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -