2

I have an Azure-SQL db that I want to connect to but I get the following error when I select MS SQL: Connect.

"A SQL editor must have focus before executing this command"

All of the solutions point towards setting the language to SQL using Ctrl-K M but that does nothing. I've uninstalled and reinstalled VS Code as well as the extensions.

I've also added just about every SQL extension I can find but feel free to recommend any you think might be valuable.

Any suggestions or help would be great.

Lazzo
  • 31
  • 1
  • 4

2 Answers2

3

you probably don't need this anymore but here's the solution if anyone has this problem you just need to create a new file in VS Code and specify SQL as the language then you can run SQL Server commands on VS Code. More instructions can be found here: https://learn.microsoft.com/en-us/sql/visual-studio-code/sql-server-develop-use-vscode?view=sql-server-2017

0

I found a way around this. Instead of using the SQL:Connect command from the extensions menu I selected the Disconnected button in the footer of the window. That allowed me to set up a connection. enter image description here

Corv1nus
  • 4,523
  • 1
  • 26
  • 37