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:
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.
I configure two database connections, which you can choose by pressing Ctrl-Shift-E before it execute the SQL Script.
The result from the SQL Script will be displayed on the right side of the editor.
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.