SQL History function provides for automatic logging of the SQL statements executed from the SQL Editor to an external text file and facilitates their easy review and re-execution.
SQL History dialog box can be invoked using top-level Tools -> SQL Editor -> SQL History menu or from SQL Editor’s popup menu.
It displays all SQL statements executed from all SQL Editors in Server Studio application.
To enable logging of all executed statements to a text file, check “Automatically save SQL log into a file” checkbox in SQL History dialog box. You can optionally change log file name. Default file name is:
You can filter SQL statements using a partial text match. Enter any part of SQL statement text, such as a table name, procedure name or SQL keyword, which must be present in required SQL statements, into ‘Filter by SQL text’ field and the SQL history grid starts filtering as you type.
You can sort statements in the list by any column, such as Date/time or Execution time, by clicking on a column header.
For example, to find all INSERT statements recorded against a table ‘tbl_order’, type ‘tbl_order’ into SQL text filter field, and then click on SQL Statement column to sort the filtered list by statement types. In the displayed result, you will easily see all INSERTS, which involved table ‘tbl_order’.
Field ‘Max SQL History log records to log’ allows to limit a number of log records displayed in the grid (in chronological order) If this number is too big and you have many records in the SQL History log file, it might take a longer time to open SQL History dialog box, and it also consumes the application memory. It is recommended to keep this parameter at around 1000 records by default and load all historical records only if you really need to search it for a SQL statement executed a long time ago. Press Apply button to change this parameter and re-load SQL History records.
If you do not want to load SQL statements from the log file at all and just want to see statements executed during the current Server Studio session, set ‘Max SQL History log records to log’ to 0.
To transfer SQL statement or multiple statements from a
log to new SQL Editor, select required statements in executed statements grid
using checkbox in the left cell and press ‘Open In SQL Editor’ button.