Eric Flamm Flamm Consulting, Inc. Use Visual Studio Code to Access SQL Server from Windows (or Mac, or Linux, or ...)
Agenda Intro About VS Code and the MS SQL Extension Demos Resources Q & A
About Me Independent Business Intelligence/Analytics Consultant MCP: Querying Microsoft SQL Server 2012 Member of TAG Data Science and Analytics Society Board Active Volunteer with Atlanta Microsoft Database Forum (local PASS Chapter) Organizing Committee for Atlanta SQL Saturday since 2010 Contact Info: E-mail: eric@flammconsulting.com Mobile: (678) 524-4256 Twitter: @eflamm Web: www.flammconsulting.com
Poll Heard of VS Code? Use VS Code? Used VS Code with MS SQL? What… is the air-speed velocity of an unladen swallow?
About VS Code Home Page: code.visualstudio.com/ Built on Electron Shell using Python on Node.js Built to support Javascript/TypeScript development 1000’s of extensions provide support for multiple languages/development environments
About the MS SQL Extension Home Page: docs.microsoft.com/en-us/sql/linux/sql-server-linux-develop-use-vscode The MS SQL extension enables you to connect to SQL Server, compose and execute T-SQL Queries, and view the results
How to Get VS Code Windows – Download and run the installer from the VS Code Getting Started page Linux – Depends on the distro – download the appropriate package, update the package store, and install with yum or apt‐get Mac – download the VS Code archive from https://code.visualstudio.com/docs/setup/mac and expand it to retrieve the app launcher
How to get the MS SQL Extension Open the Command Palette, select Install Extension, enter mssql, and click Install On Mac, you need OpenSSL for .net Core (used by mssql extension) – instructions are on the mssql extension page Older versions of Windows require the Windows 10 Universal C Runtime (WindowsUCRT.zip)
Demos Create a SQL Server Connection Object Connect to SQL Server Create a database Create a table Load some data Retrieve some data Save results to JSON file Demos - alternate between Windows and Linux Create a connection to Azure SQL server (on both platforms) Open a new SQL document and connect to server (show connection info on status bar) Create Database for Grail Trivia Create Table for Grail Trivia Load Trivia items into table Retrieve Trivia items from table
VS Code Settings "server": "uxjf04zebq.database.windows.net", "database": "", "authenticationType": "SqlLogin", "user": "eflamm", "password": "", "savePassword": false, "profileName": "azuresql", "connectTimeout": 30, "encrypt": true, "applicationName": "vscode-mssql"
Resources Use Visual Studio Code to connect and query data (https://docs.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-vscode)