Is there a way to program sql execution from excel?

15 views
Skip to first unread message

Martin Benum

unread,
May 23, 2021, 10:22:44 AM5/23/21
to SQL Workbench/J - DBMS independent SQL tool
I use Excel vba macros as the engine to open workbench , manually paste the sql that I want to run from the clipboard, manually execute the sql and then manually close workbench

Every time I open workbench I have to select OK to go to connection profile. then  I go to statement 1 and have to manually clear what was run last time, paste the sql, and then execute  (Ctrl A, Ctrl V, Ctrl E) wait for execution to run and then close the program.

Is there a way to code this in the execution code I have in excel that would seamlessly open workbench to  the connection profile , open a clean tab, paste and or run the sql I want to run and start execution. 

Thanks

Thomas Kellerer

unread,
May 24, 2021, 12:37:39 PM5/24/21
to sql-wo...@googlegroups.com
You can run SQL Workbench in "batch mode" (i.e. no GUI) and you provide the complete connection information and a SQL script to be run on the command line.

For details please see the manual: https://www.sql-workbench.eu/manual/using-scripting.html

Regards
Thomas
Reply all
Reply to author
Forward
0 new messages