This article describes how to manage executed queries, search its content and re-use them, using the Executed queries feature.
To enable the Executed queries feature, check the Log executed queries option:
Once the feature is enabled, the information about the executed queries can be accessed through the Executed queries form, which can be initiated from the ApexSQL Complete menu, clicking the Executed queries command from the drop down list:
This will open the Executed queries form:
The executed queries shows the information about the date and time of the execution, status of the query (failed, completed with or without errors), the user who executed a query, database against the query was executed and the duration of the execution. Each of these segments can be used as a grouping criteria. Dragging the header of the column and drop it in the area above the list of executed queries, the list will be grouped:
Searching the executed queries
The content of the executed queries can be searched through the search box at the top of the form. Specifying the search hint and searching through the executed queries will show a list of all queries that contain specified term, and in the query content preview, searched term will be highlighted:
Re-using executed queries
Content of each query from the Executed queries form can be copied and re-used. By double clicking the query from the list will automatically put the query content in a new query window:
Q: Can I browse the executed queries even if the Executed queries feature is disabled?
A: Yes, all executed queries are accessible from the Executed queries form, no matter if the feature is enabled or disabled.
Q: Will the executed queries information will be deleted when the Executed queries feature is disabled?
A: No, already logged executed queries will not be deleted, but all queries executed after disabling the feature won’t be logged.
Q: Will the installation or upgrade of ApexSQL Complete delete the information about executed queries?
A: No, uninstallation, or upgrade to a newer version does not affect saved information about executed queries, unless they are manually removed or edited.
Q: Where the information about executed queries is stored?
A: By default, the information about executed queries is stored in the following location:
Q: What is the way the information about executed queries is stored?
A: The information about executed queries is stored in a way that a separate folder is created based on date (i.e. 07-11-2015). Each folder contains an xml file where the information about all executed queries for the specified date is stored.
Q: Can I edit the information about the executed queries outside the host application (SQL Server Management Studio or Visual Studio)?
A: Yes, xml files that keep store the information about executed queries can be edited. However, this is not recommended, since there is a possibility to break the structure of the xml file and it won’t be loaded in the Executed queries form, or it won’t show the information properly.
Q: What is the minimum date that can be set in the “From” date filter?
A: This can be set in the Executed query tab, under the ApexSQL Complete options. Changing the Default period option:
Q: If I execute the same query multiple times, will this be shown as a separate execution, or the newer execution overwrites an older one?
A: Each execution will be saved as a separate event, since ApexSQL Complete logs executed queries by the time of the execution regardless of a query content.
Q: Can I use the information about executed queries on another machine?
A: Yes, just copy the Executed queries folder and paste it to the corresponding folder on another machine. After the host application is started, all information will be accessible through the Executed queries form.