merging two database files into a new one

Just starting out? Need help? Post your questions and find answers here.
User avatar
A.D.
User
User
Posts: 98
Joined: Tue Oct 06, 2009 9:11 pm

merging two database files into a new one

Post by A.D. »

Hello there!

i have two database files with the same structure and i would like to merge them into a new database file. How can i achieve that? I was thinking to create an empty database with exactly the same tables and indexes and then import the data from the other 2 databases by .export csv & .import csv to table. Since i haven't much knowledge about SQL i already read a bit about it and studied the structure of the databases with a database viewer. Would you recommend doing this by CSV import functions?

Greetings
A.D.
Repeat
PureBasic
ForEver
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: merging two database files into a new one

Post by skywalk »

Use sql attach database and select all rows within an insert statement.
Do not select rowid, else that exists in 1st db.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: merging two database files into a new one

Post by infratec »

Which database :?: :?: :?:

SQLite
PostgreSQL
MariaDB
if ODBC which database is behind ...
Post Reply