Running Dbeaver 21.3.0 on ubuntu linux 21.1. The problem I have is that when trying to execute a query I get a "no active connection error". However in the Database navigator screen I have an active remote ms-sql-server connection, can see the overall database, and all files in it, can check all of their column properties etc. How do I get this particular script to associate with that particular database? I'd also like to have it automatically associated the next time I open the script?
Asked
Active
Viewed 2.4k times
16
-
2Have you read the [Active Database/Schema Selection](https://dbeaver.com/docs/wiki/SQL-Editor#active-database-schema-selection) documentation yet? – AlwaysLearning Dec 10 '21 at 12:01
-
1@AlwaysLearning Yes, did find the answer in there ... I did some digging around previously but didn't come across this. Thx. – Jim Maas Dec 10 '21 at 13:22
2 Answers
47
Picking an active connection in the menu bar (SQL Editor > Set active connection) solves the issue.

Ian Campbell
- 23,484
- 14
- 36
- 57

Tomek G
- 581
- 3
- 12
-
1Note to any future flaggers: this isn't a link-only answer. It includes the bare minimum details required in text, making the image a support image. That said, Tomek, I highly recommend you expand your answer to include a few more details, assuming you have any. This includes what to do after clicking that button, if there is anything else to do, as well as why it helps, assuming you know or think you have a reason why. If not, that's fine. This still qualifies as an answer – Zoe Dec 16 '21 at 12:00
-
1Hey sir @tomek-górnicki, thank you so much for this answer, you saved my life at midnight – NoahVerner Mar 06 '22 at 08:21
-
There is a dropdown above the SQL Editor that lets you do the same thing. Note you may have to check "show all projects" in the dialog that pops up. – Noumenon Aug 06 '23 at 23:54
3
Updating @Tomek's answer: After choosing set active connection you need to select the DB you want to work with. And it appears there is no way for now to auto-link your SQL script with certain DB, so you need to choose active connection for any new or opened SQL script.