Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
426 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Some other pages relevant to this blog include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
| Writing SQL in Visual Studio Code |
|---|
| With Microsoft's announcement of the retirement of Azure Data Studio we thought it was a good idea to look at its official replacement: the SQL Server (mssql) extension for Visual Studio Code. This blog shows you how to install and use the extension to work with SQL Server databases and compares it with SQL Server Management Studio. |
In this blog
Microsoft introduced Azure Data Studio as a lightweight, cross-platform alternative for SQL Server Management Studio (SSMS). While it doesn't replicate all the functionality of SSMS (particularly for database administrator tasks), it does have some fun extra features which are great for analysts and general SQL developers.

A fully-supported dark mode and integrated visualisations like this chart are two big improvements over SSMS!
Microsoft recently announced that Azure Data Studio will be retired on the 28th of February, 2026. This blog takes a look at the officially recommended replacement: the SQL Server (MSSQL) extension for Visual Studio Code.
If you don't already have Visual Studio Code, you'll need to install it! You can download the installer for Visual Studio Code from this webpage.

Follow the instructions to install Visual Studio Code on your machine.
When the installer has finished, you can open Visual Studio Code.

The Visual Studio Code window.
There are many settings you can change in Visual Studio Code. To open the settings page, press Ctrl + , or click the "gear" icon at the bottom of the Activity Bar and choose Settings.

Click the "gear" and choose this option from the menu.
One setting you may want to change immediately is the application's theme, particularly if you're not a fan of dark mode!

You can search for settings in the search bar at the top of the Settings page. Here we're choosing the Color Theme for the application.
Next, you'll need to install the MSSQL extension. To do this, click the Extensions button in the Activity Bar on the left of the Visual Studio Code window.

Click the Extensions button or press Ctrl + Shift + X to view extensions.
At the top of the Extensions pane, begin typing the name of the extension until it appears in the list. You can click the name of the extension to read more about it, or just click the Install button to install it.

We're choosing to install the extension immediately.
When the installer has finished, you should see some new buttons in the Activity Bar on the left of the screen.

The SQL Server button should appear in the Activity Bar.
To connect to a SQL server, click the SQL Server tool in the Activity Bar and choose to add a new connection.

Click Add Connection.
Fill in the Connection Dialog page which appears then click Connect to connect to your server.

Enter the details for the server and database you want to connect to.
When the connection has been established, you should see a list of database objects in the SQL Server pane.

This should look familiar if you've used SSMS or Azure Data Studio.
To create a query, right-click the connection you've created and choose New Query.

Choose this option to open a new query file.
You can then write your query as normal in the code window which appears.

The IntelliSense system behaves just as in Azure Data Studio.
To execute your query, press Ctrl + Shift + E or click the Execute Query button above the code window.

Here we're clicking the Execute Query button to show the Query Results panel.
Unlike in SSMS, Visual Studio Code allows you to sort and filter the results of the query without needing to edit the code. Each column in the results grid has an up/down arrow button you can click to sort the results, and a filter funnel button you can use to apply filters.

Here we're filtering the results by the Title column.
You can also change the display of the results grid and quickly export the output to different formats using the buttons on the right-hand side of the grid.

The four buttons on the right of the results grid control where the results go.
From top to bottom, the four buttons allow you to:
Show the results in text view.
Save the results as a CSV file.
Save the results as JSON.
Save the results to Excel.
At the time of writing, there is no option to display the query results as a chart as in Azure Data Studio.
A very useful feature of the MSSQL extension for Visual Studio Code is the ability to see a history of the queries you've executed. You can use the Query History pane to open a previous query, even if you didn't bother to save it!

Right-click on a query and choose to open it.
As well as writing queries, you can design database tables in Visual Studio Code. To do this, right-click the Tables folder of the database you've connected to and choose New Table.

You could also right-click an existing table and choose Edit Table to modify its design.
You can then use the table designer to add columns, keys and other features to your table. When you've finished you can click Publish to add the table to the database.

If you've created tables before, the designer is fairly intuitive.
After clicking Publish, you'll need to confirm that you want to change the design of the database.

Check the box and click Update Database to create the new table.
Azure Data Studio doesn't have a built-in capability to work with database diagrams, but the MSSQL extension for Visual Studio Code does! To open a database diagram, right-click the database you've connected to and choose Schema Designer.

Choose this option to open the database diagram.
The database diagram will open in the main window, showing how the tables in the database are related.

You can roll your mouse wheel to zoom in and out.
You can edit tables and their relationships in the diagram.

Click the pencil icon on a table to open the Edit Table pane.
To edit a relationship, you can select the Foreign Keys tab.

This page lets you edit existing relationships and create new ones.
You can also create a new relationship by clicking and dragging the blue dot from a foreign key field to the primary key field of another table.

We're dragging from the ProducerID field in the Film table to the ProducerID field in the Producer table.
To finish this blog, here's a quick summary of the differences between the main applications used to work with SQL Server:
Feature | SQL Server Management Studio | Azure Data Studio | Visual Studio Code |
|---|---|---|---|
Supported platforms | Windows only | Cross platform | Cross platform |
Database diagrams | Yes | No | Yes |
Table designer | Yes | Yes | Yes |
Visualisations (charts and maps) | No | Yes | No |
Query history for unsaved queries | No | No | Yes |
Dark mode | No | Yes | Yes |
The MSSQL extension for Visual Studio Code doesn't yet provide the full functionality of SSMS or Azure Data Studio, but it is still in development. You can see the roadmap for additional features at this link.
Some other pages relevant to this blog include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2026. All Rights Reserved.