Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Merging two databases into one
I currently have two databases which contain the same database structure
but different data. How do I merge the two databases into one single
database?



*** Sent via Developersdex http://www.droptable.com ***

Report this thread to moderator Post Follow-up to this message
Old Post
Enoch Chum
07-30-05 01:23 AM


Re: Merging two databases into one
You can do it using T-SQL queries.

How do you want to merge the data? Just copy all the data from dbA to dbB or
all the data from dbB to dbA. Do you have to resolve any conflicts? that is,
could the same key can have different data in different databases?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/


"Enoch Chum" <enoch.chum@wcb.ab.ca> wrote in message
news:ucNXVxIlFHA.1968@TK2MSFTNGP14.phx.gbl...
>I currently have two databases which contain the same database structure
> but different data. How do I merge the two databases into one single
> database?
>
>
>
> *** Sent via Developersdex http://www.droptable.com ***



Report this thread to moderator Post Follow-up to this message
Old Post
Narayana Vyas Kondreddi
07-30-05 12:23 PM


Re: Merging two databases into one
Hi,

To add on to Vyas, Incase if you have same table definitions in both
databases and different data then use:-

Insert into DBnameA..Tablename select * from DBnameB..tablename where
condition....


Do the above for all tables.. In your query take care of constraints as well
as identity.

Thanks
Hari
SQL Server MVP

"Narayana Vyas Kondreddi" <answer_me@hotmail.com> wrote in message
news:OGmJfFPlFHA.2860@TK2MSFTNGP15.phx.gbl...
> You can do it using T-SQL queries.
>
> How do you want to merge the data? Just copy all the data from dbA to dbB
> or all the data from dbB to dbA. Do you have to resolve any conflicts?
> that is, could the same key can have different data in different
> databases?
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/
>
>
> "Enoch Chum" <enoch.chum@wcb.ab.ca> wrote in message
> news:ucNXVxIlFHA.1968@TK2MSFTNGP14.phx.gbl... 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Hari Prasad
07-30-05 02:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:47 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006