Command line dot-commands

Other topics

Exporting and importing a table as an SQL script

Exporting a database is a simple two step process:

sqlite> .output mydatabase_dump.sql
sqlite> .dump

Exporting a table is pretty similar:

sqlite> .output mytable_dump.sql
sqlite> .dump mytable

The output file needs to be defined with .output prior to using .dump; otherwise, the text is just output to the screen.

Importing is even simpler:

sqlite> .read mytable_dump.sql

Contributors

Topic Id: 3789

Example Ids: 14325

This site is not affiliated with any of the contributors.