Dump Entire Database Into file using DUMP Command
Here, we will dump an entire database into a file using the DUMP command. To do that firstly, we need to provide the name and extension of the file in which we want to store the result with the .output command. Then we have to use the .dump command.
Query:
.output <Location of File with Filename.Extension>
.dump
Now, we will store all those commands i.e the output of the .dump command to a text file named Employee_Details.txt. Write the below commands one by one, just replace the file’s location with the user’s one:
Query:
.output C:\Users\user\Downloads\SQLite\Database_Details.txt
.dump
Output:
Explanation: Here we are providing the entire path and the name of the file in which we want to store the results of the dump dot command. Even though the file and the SQLite resides in the same folder, it is recommended to provide the entire path of the file to stay on the safer side. After that we will just run the DUMP command and everything will be stored in the file we mentioned in the previous step alongwith the .output command.
Content saved in the Output File:
SQLite Dump Command
SQL stands for Structured Query Language, which is the common language (with minor changes) used to manipulate relational databases. It is used to create, store, retrieve, and manipulate databases and tables. SQLite is a lightweight version of SQL with some major changes, it doesn’t have a separate server, it is not a common language, and it can’t connect with databases like Oracle or MySQL server.
In this article, we will learn about DUMP Command in SQLite in depth along with its examples, practical implementations, and so on.
Contact Us