Executing SQL at Connect and Disconnect
Connection hooks defines optional SQL commands that are sent to the database at connect and just before disconnect. They are typically used to initialize the database session with custom settings and to clean up various resources at disconnect.
You can enter the SQL you want to execute in the Properties tab for the connection, in the Connection Hooks category.
You can also set this for all database connection of a certain type. Then you instead do.
- Open the Tool Properties window
- Under the Database tab, select the specific database and the Connection Hooks category from the tree
- Enter the SQL in the shown Database Connection Hooks panel.