I already used Microsoft SQL Server 2005 and found really easy to execute single/multiple lines of an sql query. Example:
insert into tablea ($vala, $valb, $valc) values ($vala, $valb, $valc); insert into tableb ($vala, $valb, $valc) values ($vala, $valb, $valc);
How can I execute the second part only? In MSSQL i will highlight the second insert statment and press F5. How can do this in mySQL?
asked Jun 9, 2009 at 10:15 David Bonnici David Bonnici 6,737 13 13 gold badges 55 55 silver badges 74 74 bronze badgesThe problem is that you must be trying to execute your query from a Query Tab rather than from a Script Tab. Go to File -> New Script Tab and input your multiple statements there. Next click the execute button. that's it.
answered Apr 13, 2010 at 0:49 69 1 1 silver badge 2 2 bronze badges In Workbench 6.2 there isn't File -> New Script Tab Commented Dec 19, 2014 at 11:05You can do this. When you have logged into MySQL query browser, and you write two complete statments such as:
select "hello world"; select "second query";
You will notice two blue dots on the left side of the window they are left of the line numbers. By default it will try to exec the first command. That might be why you see one command with white background and all the others with a grey background. The command that is white, is highlighted and it is the one that will be executed. You should be able to just click anywhere inside the second query to highlight it and then click the lightning bolt button (execute) to run it.