Execute SQL Tab
- Updated2025-07-21
- 3 minute(s) read
Execute SQL Tab
Execute SQL Tab
Use the Execute SQL tab to execute SQL queries on a database connection. Select File»New Execute SQL Tab or press <Ctrl+E> to create a new Execute SQL tab.
The Execute SQL tab contains the following options:
- SQL Editor Window —Contains a text editor in which you can enter SQL queries to execute. The SQL queries you enter can contain a single command or multiple delimited commands . Use the context menu options for formatting the text. Press <Ctrl+F> or launch the Find window from the context menu to perform find and replace operations.
- Data Grid —Displays any table data the executed query returns. The Next Result and Previous Result buttons are available when multiple tables exist.
- Results Tab —Contains a data grid . If the SQL query does not return any table data, this tab is not visible.
- Output Tab —Displays the executed SQL query, the status of the execution, and any errors that occur on execution. The Database Viewer appends the status of the latest execution to the end of the previous output.
-
Status Bar
—Displays the status of the database connection and query execution. The status bar includes the following information:
- Database Connection —Displays the name of the connection associated with the tab.
-
Connection Status
—Indicates one of the following statuses of the database connection.
- Connected —An open connection to the database exists.
- Disconnected —The database connection is closed but still valid. The next time you perform an operation, the Database Viewer reopens the connection and uses the reopened connection.
- Expired —The database connection is broken, and the Database Viewer returns an error when you try to reconnect.
-
Query Execution Status
—Displays one of the following statuses of the last executed query.
- None —No executions have been completed.
- Query Executed Successfully —The SQL query was executed without errors.
- Query Executed with Errors —The SQL query execution resulted in errors.
-
Rows Affected
—Displays the number of rows the last executed query affects. Typically, only queries that perform insert, delete, or update operations affect rows in a table.
Note MySQL also returns the number of rows retrieved by a Select command as rows a query execution affects.
- Auto-Refresh Status —Indicates whether the Auto-Refresh option for the tab is enabled or disabled. If Auto-Refresh is enabled, the status bar also displays the user-specified time interval in seconds.
The Execute SQL tab also contains the following options:
-
Execute
—Sets and executes the SQL query against the database connection associated with the tab. You can also press <Ctrl+F5> to perform this command.
Note Schema update operations that SQL queries execute from the Execute SQL tab do not update the Database Object View. The view updates the next time you refresh the connection.
- Refresh —Executes the set SQL query again. This operation maintains any specified custom settings for displaying data in the data grid. You can also press <Ctrl+R> to perform this command.
- Stop Execution —Cancels the execution of the query. You can also press <Shift+F5> to perform this command.
- Load from SQL File —Launches an Open File dialog box in which you can specify a .sql file to load. The contents of the file replace any existing content in the SQL Editor window. You can also press <Ctrl+L> to perform this command.
- Save to SQL File —Launches a Save File dialog box in which you can specify a path to save the current content of the SQL Editor as a .sql file.
-
Auto-Refresh
—Updates the data the data grid displays in a user-specified time interval. When you enable Auto-Refresh, the query in the SQL editor executes and displays the returned data, if any. When the specified time interval elapses, the same query executes again.
Note
- If the specified time interval elapses when the current execution is in progress, the query executes again only after the time interval elapses a second time.
- If you add or remove any columns from a table after the SELECT query executes, the data grid does not display the updated columns even if you issue a Refresh or Auto-Refresh command. You must execute the query again to obtain the updates to the columns.
- If Auto-Refresh is disabled, clicking the Auto-Refresh button launches the Auto-Refresh Options dialog box.
- If Auto-Refresh is enabled, clicking the Auto-Refresh button disables Auto-Refresh.
- Print —Launches the Print dialog box.
- Export Data —Launches the Export Document dialog box.
- Clear Output —Clears the execution history the output tab displays. You can also press <Ctrl+D> to perform this command.
- Save Output —Launches a standard Save File dialog box, in which you can specify a path to save the current content of the Output window as a text file.