SQLite database corruption (SQL History)
Published 23 March 2026
In some cases, SQL Prompt's local SQLite database (used for SQL History) may become corrupted. This can lead to issues such as loading query history, missing history entries, or errors such as "database disk image is malformed."
The SqlHistory.db file is located within the SQL Prompt data folder under your local AppData directory (AppData\Local\Red Gate\SQL Prompt 11)
Important
Deleting or resetting the SQL history database will result in permanent loss of stored query history.
Attempt Recovery
- Make a backup copy of the corrupted SqlHistory.db file.
- Follow the SQLite recovery guidance:
https://sqlite.org/recovery.html
Recovery is not guaranteed and may only restore partial data.