Sunday, January 30, 2011

sqlite dump

copied from http://stackoverflow.com/questions/75675/how-do-i-dump-the-data-of-some-sqlite3-tables

You don't say what you wish to do with the dumped file.

I would use the following to get a CSV file, which I can import into almost everything

.mode csv 
.header on 
.out file.dmp 
select * from emp;

If you want to reinsert into a different SQLite database then:

.mode insert 
.out file.sql 
select * from em

No comments: