My latest course on Pluralsight, Cross-platform SQL Server Management for Developers using VS Code, went live earlier this month (just as I was about to hop on a plane for 2 weeks of conference travel!)
This is a course on a Visual Studio Code extension that I enjoy using so much that I wanted to share it with you. It is the mssql extension which lets you interact with SQL Server in a fairly rich way that belies the lightness of the IDE which it extends. Because VS Code is cross-platform, so are all of its extensions. So you can use this while you are coding on Windows, Mac or Linux and want to do some basic interaction with a SQL Server database.
As SQL Server examples, I used SQL Server LocalDb on Windows, SQL Server for Linux in a Docker container on a Mac and Azure SQL in the cloud. The course starts not only y showing you how to install VS Code (and some VS Code basics) and the extension but also by walking you through how to set up each of the database servers. That means it also has a lesson on Docker , installing and running an image as well as a quick start on creating a new SQL database in the Azure portal.
Once everything is set up, I dig through the features and functionality of the mssql extension. And I turned over ever possible stone to make sure you don’t miss helpful features which is the norm if you just start using such a tool without any preparation.
The course is mostly demos and very light on Powerpoint slides and I do work in Windows, on my Macbook and even in a Linux virtual machine.
What I’m also proud about this course is that if you’ve never used VS Code before, you’ll learn how to get around this amazing editor. If you’ve never used Docker before, I provide a really helpful and gentle introduction and you’ll be able to work with it. I had some great support from the team responsible for this extension as they were so happy to have this kind of attention paid to it.
So whatever language you code in, whatever O/S you work on, if you are using SQL Server (or interested in using it), this course should be a great help in mastering this very handy extension!
Below is the Table of Contents for the course.
If you need a 30-day free trial to the Pluralsight library so that you can watch this, send me a note!
Module 1: Introducing and Installing VS Code and the mssql Extension
In this module you’ll get a short introduction to the cross-platform and free developer IDE, Visual Studio Code and its mssql extension, The extension allow you to perform some key interactions with a SQL Server database without leaving the IDE. You’ll also walk through installing both the IDE and the extension on Windows and macOS
- Module and Course Overview
- Introducing Visual Studio Code and the mssql Extension
- Installing Visual Studio Code on Windows
- Installing Visual Studio Code on macOS
- Introducing Visual Studio Code’s Coding Super Powers
- Installing the mssql Extension in VS Code
Module 2: Preparing SQL Server for Any Platform, Locally and in the Cloud
In this module, you’ll learn how to set up a variety of SQL Servers. All of them are quick to install. You’ll learn to install SQL Server LocalDb on Windows, create an Azure SQL Database in the cloud and use a Docker image of SQL Server for Linux to quickly spin up SQL Server in a container on macOS. This will ensure that you have a SQL Server database to interact with in the rest of the course.
- SQL Server LocalDB: The Simplest SQL Server
- Setting Up an Azure SQL Database in the Cloud
- Verifying the New Azure SQL Database
- Setting Up the Last Details of Your Azure SQL Database
- Using a Docker Container to Host SQL Server for Linux on Any O/S
- Installing Docker and Getting the SQL Server Container Running
- Verifying the Containerized Database
- Understanding Persistence and Lack of Persistence in Containers
- Pulling a Custom Image with the Sample Database in Place
Module 3: Connecting to the Various SQL Servers From Various Platforms
In this module, you’ll learn the ins and outs of connecting to a variety of local, cloud and containerized SQL Servers with the mssql extension. You’ll learn how to use the commands and shortcuts, how connection profiles and passwords are stored and even how to create a handy shortcut for getting mssql started.
- mssql’s Commands and Execution Engine
- Connecting to LocalDB While Learning More About mssql Connections
- Connecting to Azure SQL from Windows and macOS
- Demonstrating How mssql Securely Stores Your Passwords
- Using ADO.NET Connection Strings to Connect
- Connecting to the Database in the Docker Container
- Connection Keyboard and Status Bar Shortcuts
- Creating a Keyboard Shortcut to Start up mssql and Connect
Module 4 : Learning the mssql Basics to Connect, Query and Create
In this module you’ll start interacting with the database, executing queries and commands, and exploring result sets. You’ll learn about the snippets and also learn about attaching to existing database files and creating new databases from scratch. Most importantly you’ll learn about the great SQL editor and result view support that the mssql extension brings to you.
- Attaching an Existing Database File
- Interacting with the Results of Your First Query
- The Intelligent Editor Window
- Using Snippets to Speed Up Command Building
- Exploring Multiple Result Sets Further
- Using Snippets to See Database Metadata
- Creating Databases, Tables and Data
Module 5: Leveraging Advanced Tips & Tricks
This module will dig deeper into mssql and provide tips that take advantage not just of mssql features, but also capabilities of Visual Studio Code to make using mssql easier.
- Exporting Results to CSV, JSON or Excel
- Localization of mssql’s Messages
- Controlling Behavior Through VS Code’s Settings
- Formatting Code in the Editor Window
- Results Window Tricks, Shortcuts & Settings
- Checking Out the Last Few Settings
- Creating Your Own SQL Snippets in VS Code
- Looking Ahead to Integrated Authentication on Mac and Linux