SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Can i put back the data into database?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

manjeet_kaur81
Starting Member

India
4 Posts

Posted - 10/07/2005 :  09:03:56  Show Profile  Reply with Quote
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  Show Profile  Visit bakerjon's Homepage  Reply with Quote
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

India
4 Posts

Posted - 10/07/2005 :  09:33:55  Show Profile  Reply with Quote
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

United Kingdom
22431 Posts

Posted - 10/07/2005 :  09:58:35  Show Profile  Reply with Quote
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

India
22772 Posts

Posted - 10/07/2005 :  10:05:13  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Kris, you told what I thought

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000