On Tue, Jul 06, 2010 at 04:42:05PM -0500, Peng Yu scratched on the wall:
> I could create tables in database B to select all the data from
> database A and insert them in B. I don't find any simpler way to copy
> all tables from A to B. But I may miss something.
> 
> I'm wondering if there is a very simple single command that can just
> copy all the tables from database A to database B. Could you please
> let me know?

  No.  Your best bet is to select the sql column from sqlite_master,
  re-execute the command to create the exact same tables, and then
  attempt to copy the data with an INSERT...SELECT command.  This
  usually only works with simple tables, however, and gets messy with
  indexes, foreign keys, and other constraints.

  If you really want to see how to do it, look at the code for VACUUM.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to