I have tried to find an answer to how to stop the execution of SQL scripts in MySQL Workbench. It should be easy to find a solution (if it's possible)... but I haven't found anything.
In MySQL Workbench I execute a couple of SQL commands in sequence. But I would like to stop the script execution after a while. Here's an example of what I try to achieve:
SELECT "Hello";
STOP; # What command can I use here to stop the execution?
SELECT "World";
I don't want the SELECT "World"
to execute.
CodePudding user response:
You can use ## at start of the line for one line or / / for mor lines like:
SELECT 1;
-- SELECT 1;
/*
SELECT 1;
SELECT 2;
SELECT 3;
*/
SELECT 99;
Any statement that causes an error will stop execution.