sql-workbench-j

How do you change your active database connection in SQL Workbench/J?


Is it possible to change your active/default database connection in SQL Workbench/J while still under a single connection profile? There are times I am connected to a database server with multiple databases and I would like to switch my active database without having to use a USE statement, specify the full 3 part naming convention, or switch connection profiles entirely. In SSMS, there is a simple drop-down menu to easily switch between different databases. Just wondering if there is something similar in SQL Workbench/J that I'm just missing.


Solution

  • There is an experimental feature to enable a dropdown with the available databses in the main window.

    If you run

    WbSetDbConfig gui.enable.dbswitcher=true;
    

    in a SQL editor tab when connected to a SQL Server database, then you should have a dropdown to switch the current database after restarting SQL Workbench/J.

    It will essentially issue a USE in the background for the current connection when using SQL Server.