Executing Converted Scripts with Run Query
During database migration, it is often necessary to verify converted code directly in the target database. For example, after reviewing or manually adjusting a converted object, you may want to execute the updated script, test a specific statement, or run a query against the migrated objects without leaving SQLWays.
The Run Target feature allows you to execute converted SQL code directly from the File Editor against the configured target database and review the execution results in the Output panel.
This can simplify testing and troubleshooting of converted objects by keeping code review, editing, execution, and result analysis within the same SQLWays workspace.
Note: Currently, Run Target is available for converted scripts when PostgreSQL is used as the target database and Conversion with import is enabled for the project.
Availability of Run Target
The Run Target button is displayed in the File Editor when a converted file is opened.
The command executes SQL against the target database using the connection configured in the Target Technology section of the migration project. Therefore, a valid target connection must be available.
If Conversion with import is disabled, no target database connection is configured for execution, and Run Target is unavailable. In this case, the button is disabled.
Execution is available when Conversion with import is enabled. This prevents converted scripts from being executed when the project has no active target database connection.
Running a Converted Script
To execute converted SQL code:
- Open the required converted object in the File Editor.
- Review or edit the generated target code if necessary.
- Click Run Target.
If no text is selected in the editor, SQLWays executes the script available in the current target file. You can also use the keyboard shortcuts F5 or Ctrl+Enter to start execution for the editor that currently has focus.
Executing Selected SQL Statements
It is not necessary to execute the entire converted file. If a part of the SQL code is selected in the editor, Run Target executes only the selected fragment. This is useful when you need to test an individual statement without executing the remaining contents of the file.
For example, after a converted table has been created in PostgreSQL, you can add or select a query such as:
SELECT * FROM tvp_test.Customer;
and execute only this statement.
This makes Run Target particularly convenient for:
- validating converted SQL statements;
- checking whether migrated objects exist and are accessible;
- testing manually modified conversion results;
- executing diagnostic SELECT statements;
- reproducing an error for a specific part of a converted script.
Important: SQLWays does not request additional confirmation for potentially destructive statements. Commands such as DROP, DELETE, or TRUNCATE are executed if they are included in the executed script or selected fragment. The code should therefore be reviewed before running it against the target database.
Handling Execution Errors
If the database cannot execute the submitted SQL, the corresponding error is displayed in the Output panel.
The execution record includes the status and the error message returned during execution. Where the database provides additional information, such as an error position or line number, this information can also be used to locate the problematic statement. For example:
[02.10.2026 09:54:07] Duration: 0ms, Status: fail, <database error message>
Connection errors encountered when Run Target is started are also reported in the Output panel.
This allows you to review the converted code, identify the failed statement, make the required changes in the File Editor, save the file, and run it again without switching to an external database client.
Typical Workflow
A common workflow with Run Target is:
- Convert an object to PostgreSQL.
- Open its target file in the File Editor.
- Review the generated SQL.
- Modify the code if required.
- Select a particular statement or leave the script unselected to execute the complete file.
- Click Run Target.
- Review the result or database error in the Output panel.
- Correct the SQL and repeat the execution if necessary.
Run Target therefore provides a quick way to validate converted SQL during migration and helps reduce the need to switch between SQLWays and external database tools when investigating conversion results.
Related Topics
If you have any questions or face any difficulties, please contact our support team at [email protected].

