Page 1 of 1

merging two database files into a new one

Posted: Tue Aug 27, 2019 1:25 pm
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.

Re: merging two database files into a new one

Posted: Tue Aug 27, 2019 1:36 pm
by skywalk
Use sql attach database and select all rows within an insert statement.
Do not select rowid, else that exists in 1st db.

Re: merging two database files into a new one

Posted: Tue Aug 27, 2019 1:45 pm
by infratec
Which database :?: :?: :?:

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