VS Code working with SQL Server

VS CodeĀ editor works great and specially when using it in cross-platform environment. So, I decided to try using it connect to one of my SQL Server instance. To configure VS Code editor is simple. Make sure to check my previous blog post for information.

http://www.maxtblog.com/2016/09/vs-code-running-powershell-debug-13/
http://www.maxtblog.com/2016/09/vs-code-running-powershell-code-runner-extensions-23/
http://www.maxtblog.com/2016/09/vs-code-running-powershell-terminal-session-33/

Next we need to look which SQL extension are available. In this case I decided to use “vscode-mssql” extension:

vscodesql_01_2016-09-30

After installing, we need to customized their setting by creating connection(s) to our SQL Server. We do this by opening VS Code “User Preferences” and under “Default Settings.json” we search for the “vscode-mssql” settings to be copied over to our working folder “settings.json” file.

vscodesql_02_2016-09-30

I configure two database connections, which you can choose by pressing Ctrl-Shift-E before it execute the SQL Script.

vscodesql_03_2016-09-30

The result from the SQL Script will be displayed on the right side of the editor.

vscodesql_04_2016-09-30

One thing to notice, on VS Code version 1.5.3, there’s an extension called “vscode-icons” which gives nice file icons to the working files.

vscodesql_04a_2016-09-30

vscodesql_05_2016-09-30