Top Related Projects
Free universal database tool and SQL client
Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows.
A simple and lightweight SQL client desktop with cross database and platform support.
Database management for VSCode
A lightweight client for managing MariaDB, MySQL, SQL Server, PostgreSQL, SQLite, Interbase and Firebird, written in Delphi
Quick Overview
Microsoft's vscode-mssql is an extension for Visual Studio Code that provides support for developing and managing Microsoft SQL Server, Azure SQL Database, and SQL Data Warehouse. It offers a rich set of features including IntelliSense, syntax highlighting, connection management, query execution, and result visualization.
Pros
- Seamless integration with Visual Studio Code
- Comprehensive SQL Server management capabilities
- Cross-platform support (Windows, macOS, Linux)
- Regular updates and active community support
Cons
- Limited advanced database administration features compared to full-fledged SQL management tools
- Occasional performance issues with large result sets
- Learning curve for users new to VS Code extensions
Getting Started
- Install Visual Studio Code
- Open VS Code and navigate to the Extensions view (Ctrl+Shift+X)
- Search for "mssql" and install the "SQL Server (mssql)" extension
- Restart VS Code after installation
- To connect to a database:
- Press Ctrl+Shift+P to open the command palette
- Type "sql" and select "MS SQL: Connect"
- Follow the prompts to enter your server details and credentials
- Create a new .sql file and start writing queries
- To execute a query:
- Highlight the query text
- Press Ctrl+Shift+E or right-click and select "Execute Query"
For more detailed instructions and advanced features, refer to the official documentation on the GitHub repository.
Competitor Comparisons
Free universal database tool and SQL client
Pros of DBeaver
- Supports a wide range of database systems, not limited to SQL Server
- Offers a standalone application with a rich set of features for database management
- Provides advanced visualization tools for data analysis and ERD creation
Cons of DBeaver
- Steeper learning curve due to its extensive feature set
- May be resource-intensive for less powerful machines
- Not as tightly integrated with the VS Code ecosystem
Code Comparison
vscode-mssql:
SELECT * FROM Customers
WHERE Country='Germany'
DBeaver:
SELECT * FROM Customers
WHERE Country='Germany'
-- DBeaver supports syntax highlighting and auto-completion for multiple database systems
Additional Notes
vscode-mssql is specifically designed for SQL Server integration within VS Code, offering a lightweight and focused experience. It's ideal for developers who primarily work with SQL Server and prefer the VS Code environment.
DBeaver, on the other hand, is a more comprehensive database tool that caters to a broader range of database systems. It's better suited for database administrators or developers working with multiple database types who need a feature-rich, standalone application.
Both tools have their strengths, and the choice between them depends on the user's specific needs, workflow, and the range of databases they work with regularly.
Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows.
Pros of Beekeeper Studio
- Cross-platform support for multiple database types (MySQL, PostgreSQL, SQLite, etc.)
- User-friendly interface with built-in features like query autocompletion and data export
- Open-source and actively maintained by the community
Cons of Beekeeper Studio
- Less integrated with Visual Studio Code ecosystem
- May have fewer advanced features for SQL Server specifically
- Potentially steeper learning curve for users already familiar with VS Code
Code Comparison
Beekeeper Studio (JavaScript):
import { Connection } from 'typeorm'
export async function runQuery(connection: Connection, query: string) {
const result = await connection.query(query)
return result
}
vscode-mssql (TypeScript):
import { ConnectionPool } from 'mssql'
export async function executeQuery(pool: ConnectionPool, query: string) {
const result = await pool.request().query(query)
return result.recordset
}
Both examples show basic query execution, but vscode-mssql is more focused on SQL Server specifics, while Beekeeper Studio's approach is more generic to support multiple database types.
A simple and lightweight SQL client desktop with cross database and platform support.
Pros of sqlectron-gui
- Supports multiple database systems (MySQL, PostgreSQL, SQLite, etc.)
- Standalone application, no need for additional IDE or editor
- User-friendly interface with visual query builder
Cons of sqlectron-gui
- Less integrated with development workflow compared to VS Code extension
- May have fewer advanced features for SQL Server specifically
- Potentially slower update cycle and community support
Code Comparison
sqlectron-gui (React component for query execution):
<Query
query={this.state.query}
onExecQueryClick={this.handleExecuteQuery}
onCancelQueryClick={this.handleCancelQuery}
onCopyToClipboardClick={this.handleCopyToClipboard}
onSaveToFileClick={this.handleSaveToFile}
/>
vscode-mssql (TypeScript function for query execution):
public async runQuery(connectionUri: string, selection: ISelectionData, title: string): Promise<void> {
await this._outputContentProvider.runQuery(this._statusView, connectionUri, selection, title);
this._vscodeWrapper.logToOutputChannel(Utils.formatString(Constants.msgRunQueryInProgress, title));
}
Both projects offer SQL query execution functionality, but vscode-mssql is more tightly integrated with VS Code's ecosystem, while sqlectron-gui provides a standalone solution with a focus on multi-database support and user-friendly interface.
Database management for VSCode
Pros of SQLTools
- Supports multiple database systems (MySQL, PostgreSQL, SQLite, etc.)
- Offers a more user-friendly interface for managing connections
- Provides advanced features like query history and snippets
Cons of SQLTools
- May have a steeper learning curve for new users
- Less integrated with Azure and other Microsoft services
- Potentially slower performance for large datasets
Code Comparison
vscode-mssql:
SELECT * FROM Customers
WHERE Country='Germany'
ORDER BY CompanyName;
SQLTools:
SELECT * FROM Customers
WHERE Country = 'Germany'
ORDER BY CompanyName;
-- SQLTools supports syntax highlighting for multiple DB systems
Additional Notes
vscode-mssql is specifically designed for Microsoft SQL Server, offering deep integration with Azure and other Microsoft services. It provides excellent performance for large datasets and has a simpler interface for users familiar with SQL Server Management Studio.
SQLTools, on the other hand, is a more versatile extension that supports multiple database systems. It offers a rich set of features like query history, snippets, and a more intuitive connection management interface. However, it may not provide the same level of performance optimization for Microsoft SQL Server as vscode-mssql.
The choice between these extensions depends on the specific needs of the user, such as the database systems they work with and their familiarity with different SQL environments.
A lightweight client for managing MariaDB, MySQL, SQL Server, PostgreSQL, SQLite, Interbase and Firebird, written in Delphi
Pros of HeidiSQL
- Standalone application with a user-friendly GUI, suitable for users who prefer a dedicated database management tool
- Supports multiple database systems (MySQL, MariaDB, PostgreSQL, MS SQL Server) in a single application
- Offers advanced features like data export/import, query builder, and server administration tools
Cons of HeidiSQL
- Limited integration with development environments compared to vscode-mssql
- May require separate installation and updates, unlike vscode-mssql which integrates directly into VS Code
- Less focused on specific MS SQL Server features compared to vscode-mssql
Code Comparison
HeidiSQL (SQL query execution):
SELECT * FROM users WHERE id = :id
vscode-mssql (SQL query execution):
SELECT * FROM users WHERE id = @id
Both tools support parameterized queries, but HeidiSQL uses :parameter
syntax, while vscode-mssql uses @parameter
syntax for MS SQL Server.
HeidiSQL offers a more comprehensive database management solution with support for multiple database systems, while vscode-mssql provides a tighter integration with VS Code and focuses specifically on MS SQL Server. The choice between the two depends on the user's specific needs, preferred development environment, and the database systems they work with.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
MSSQL extension for Visual Studio Code
The MSSQL Extension for Visual Studio Code is designed to empower developers by providing a seamless and modern database development experience. Our goal is to make SQL development more productive and intuitive by integrating essential features such as schema management, query execution, and AI-powered assistance.
General Availability Features
- Connect to your databases: Seamlessly manage your database connections
- Connect to SQL database in Fabric, Azure SQL, and SQL Server using a user-friendly interface
- Use an intuitive Connection Dialog to enter parameters, paste a connection string, or browse Azure resources
- Access recent connections quickly from a dedicated panel
- Use Microsoft Entra ID authentication for secure access
- Manage multiple connection profiles for different environments
- Reconnect to frequently used databases in just a few clicks
- Organize your connections into color-coded groups to manage local, staging, and production environments side by side.
- Execute queries and View Results: Run your scripts and view results in a simple, yet powerful, grid with improved data visualization features:
- View results in a unified interface alongside the integrated terminal and output panels or in their own tab.
- Sort results by clicking on column headers.
- Easily copy results with or without headers for use in other applications.
- Export results to multiple formats, including JSON, Excel, and CSV.
- Enhanced experience with live execution timing summary metrics and stability improvements on large result sets
- View estimated plan and actual plan for T-SQL queries.
- Enhanced T-SQL Editing Experience: Write T-SQL scripts with a range of powerful features, including:
- IntelliSense for faster and more accurate coding.
- Go to Definition for exploring database objects.
- T-SQL snippets to speed up repetitive tasks.
- Syntax colorizations and T-SQL error validations.
- Support for the
GO
batch separator.
- Object Explorer: Navigate and manage your database structure with ease
- Browse databases, tables, views, and programmability objects
- Expand or collapse objects to explore hierarchy visually
- Use enhanced filters to quickly locate items by name, owner, or creation date
- Streamline development in large databases with fast object access
- Table Designer: A visual tool for creating and managing tables in your databases. Design every aspect of the table's structure, including:
- Adding columns, setting data types, and specifying default values.
- Defining primary keys and managing indexes to improve query performance.
- Setting up foreign keys to maintain data integrity across tables.
- Configuring advanced options like check constraints.
- Automatically generate T-SQL scripts for your table design and apply changes directly to the database.
- Query Plan Visualizer: Analyze SQL query performance with detailed execution plans. Key features include:
- Interact with each step in the execution plan, including collapsing or expanding nodes for a simplified view.
- Zoom in or out to adjust the level of detail, or use "zoom to fit" for a complete view of the plan.
- Highlight key performance indicators, such as elapsed time or subtree cost, to identify bottlenecks in query execution.
- Customizable Extension Options: Configure command shortcuts, appearance, and other settings to personalize your development experience.
Public Preview Features
- GitHub Copilot Integration (
Preview
): Boost your productivity with AI-assisted SQL development- Get intelligent code completions and suggestions for T-SQL as you type
- Build complex queries using natural language prompts
- Explain stored procedures, views, and joins to speed up onboarding and debugging
- Generate schema objects or test data in seconds
- Identify risky patterns and improve SQL security practices
- GitHub Copilot Agent Mode (
Preview
)- Use chat in Agent mode to connect, disconnect, or switch databases
- List servers and view available connections
- Show database schema contextually
- Access all available Agent tools from the Agent Tools panel
- Local SQL Server Containers (
Preview
)- Create and manage SQL Server containers locally without Docker commands
- Use SQL Server 2025 by default with vector and AI-ready features
- Auto-connect with a ready-to-use connection profile
- Start, stop, restart, or delete containers from the connection panel
- Automatic port conflict detection and resolution
- Customize container name, hostname, port, and version
- Schema Designer (
Preview
): Visual schema modeling and editingâcode-free- Design, view, and manage database schemas using an intuitive drag-and-drop GUI
- Add or modify tables, columns, primary keys, and foreign key relationships without writing T-SQL
- Preview schema changes instantly as read-only T-SQL in the built-in code pane
- Navigate large schemas easily with search, mini-map, zoom, and auto-layout
- Export diagrams to share with your team or include in documentation
- Push updates to your database using the built-in deployment
- Schema Compare (
Preview
): Effortless schema synchronization and management- Compare schemas between two databases, DACPAC files, or SQL projects and see additions, removals, and modifications at a glance
- Filter and exclude specific differences before syncing
- Apply changes directly or generate a deployment script for later use
- Save comparisons to rerun or audit schema changes

Get Started and Learn More
- Get started with the MSSQL extension: Step-by-step tutorial to connect and query your first database
- SQL Developer tutorial: Build full-stack apps using SQL Server with C#, Java, Node.js, Python, and more
- Local development with Azure SQL: Learn how to develop locally with Azure SQL Database
- Dev Containers for Azure SQL: Set up repeatable dev environments using Dev Containers
- MSSQL extension documentation: In-depth guides and reference documentation
- GitHub Copilot with MSSQL: Use Copilot to write, explain, and refactor T-SQL
- Blog: New MSSQL extension UI: Learn about the enhanced user experience in VS Code
- Roadmap: See what's coming next
- Join the Discussion: Ask questions, suggest features, and engage with the community
Using the MSSQL Extension
Follow these steps to get started with the MSSQL extension:
- Install Visual Studio Code and then install the MSSQL extension from the Extensions view or via the command palette (
F1
, then typeInstall Extensions
). - macOS users: Install OpenSSL. See the DotNet Core instructions for prerequisites.
- Open or create a
.sql
file. To manually set language mode, pressCtrl+K M
and select SQL. - Press
F1
, typeMS SQL: Manage Connection Profile
, and follow the prompts to create a profile. See manage connection profiles for advanced options. - Connect to a database using
F1
>MS SQL: Connect
or the shortcutCtrl+Shift+C
. - Write your T-SQL script using IntelliSense and snippets. Type
sql
to explore available snippets. - Run queries by selecting MS SQL: Execute Query from the Command Palette (
F1
), or use the shortcut:
- Windows/Linux:
Ctrl+Shift+E
- macOS:
Cmd+Shift+E
View results in the result pane.
- Customize shortcuts via the command palette or in your
settings.json
. See customize shortcuts for help.
Command Palette Commands
The extension provides several commands in the Command Palette for working with .sql
files. Here are some of the most commonly used commands:
- MS SQL: Connect to SQL Server, Azure SQL Database or SQL Data Warehouse using connection profiles or recent connections.
- Create Connection Profile to create a new connection profile and connect.
- MS SQL: Disconnect from SQL Server, Azure SQL Database or SQL Data Warehouse in the editor session.
- MS SQL: Use Database to switch the database connection to another database within the same connected server in the editor session.
- MS SQL: Execute Query script, T-SQL statements or batches in the editor.
- MS SQL: Cancel Query execution in progress in the editor session.
- MS SQL: Manage Connection Profiles
- Create a new connection profile using command palette's step-by-step UI guide.
- Edit user settings file (settings.json) in the editor to manually create, edit or remove connection profiles.
- Remove an existing connection profile using command palette's step-by-step UI guide.
- Clear Recent Connection List to clear the history of recent connections.
Extension Settings
The following Visual Studio Code settings are available for the mssql extension. These can be set in user preferences (cmd+,) or workspace settings (.vscode/settings.json)
.
// General Settings
{
"mssql.maxRecentConnections": 5,
"mssql.enableRichExperiences": true,
"mssql.openQueryResultsInTabByDefault": false,
"mssql.logDebugInfo": false,
"mssql.messagesDefaultOpen": true,
"mssql.applyLocalization": false
}
// IntelliSense
{
"mssql.intelliSense.enableIntelliSense": true,
"mssql.intelliSense.enableErrorChecking": true,
"mssql.intelliSense.enableSuggestions": true,
"mssql.intelliSense.enableQuickInfo": true,
"mssql.intelliSense.lowerCaseSuggestions": false
}
// Results and Grid
{
"mssql.resultsFontFamily": null,
"mssql.resultsFontSize": null,
"mssql.copyIncludeHeaders": false,
"mssql.copyRemoveNewLine": true,
"mssql.saveAsCsv.includeHeaders": true,
"mssql.saveAsCsv.delimiter": ",",
"mssql.saveAsCsv.lineSeparator": null,
"mssql.saveAsCsv.textIdentifier": "\"",
"mssql.saveAsCsv.encoding": "utf-8",
"mssql.splitPaneSelection": "next",
"mssql.persistQueryResultTabs": false
}
// Query Formatting
{
"mssql.format.alignColumnDefinitionsInColumns": false,
"mssql.format.datatypeCasing": "none",
"mssql.format.keywordCasing": "none",
"mssql.format.placeCommasBeforeNextStatement": false,
"mssql.format.placeSelectStatementReferencesOnNewLine": false
}
// Query Execution
{
"mssql.query.displayBitAsNumber": true
}
// Shortcuts
{
"mssql.shortcuts": {
"event.toggleResultPane": "ctrl+alt+r",
"event.toggleMessagePane": "ctrl+alt+y",
"event.prevGrid": "ctrl+up",
"event.nextGrid": "ctrl+down",
"event.copySelection": "ctrl+c",
"event.maximizeGrid": "",
"event.selectAll": "",
"event.saveAsJSON": "",
"event.saveAsCSV": "",
"event.saveAsExcel": ""
}
}
See customize options and manage connection profiles for more details.
Change Log
See the change log for a detailed list of changes in each version.
Supported Operating Systems
Currently this extension supports the following operating systems:
- Windows (x64 | x86 | arm64)
- macOS (x64 | arm64)
- Ubuntu 14.04 / Linux Mint 17 / Linux Mint 18 / Elementary OS 0.3
- Ubuntu 16.04 / Elementary OS 0.4
- Debian 8.2
- CentOS 7.1 / Oracle Linux 7
- Red Hat Enterprise Linux (RHEL)
- Fedora 23
- OpenSUSE 13.2
- Linux arm64
Offline Installation
The extension will download and install a required SqlToolsService package during activation. For machines with no Internet access, you can still use the extension by choosing the Install from VSIX...
option in the extension view and installing a bundled release from our Releases page.
Each operating system has a .vsix
file with the required service included. Pick the file for your OS, download and install to get started. We recommend you choose a full release and ignore any alpha or beta releases as these are our daily builds used in testing.
Support
Support for this extension is provided via GitHub issues. You can submit a bug report, a feature suggestion or participate in discussions.
Contributing to the Extension
See the developer documentation for details on how to contribute to this extension.
Code of Conduct
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Telemetry
This extension collects telemetry data, which is used to help understand how to improve the product. For example, this usage data helps to debug issues, such as slow start-up times, and to prioritize new features. While we appreciate the insights this data provides, we also know that not everyone wants to send usage data and you can disable telemetry as described in the VS Code disable telemetry reporting documentation.
Privacy Statement
The Microsoft Enterprise and Developer Privacy Statement describes the privacy statement of this software.
License
This extension is licensed under the MIT License. Please see the third-party notices file for additional copyright notices and license terms applicable to portions of the software.
Top Related Projects
Free universal database tool and SQL client
Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows.
A simple and lightweight SQL client desktop with cross database and platform support.
Database management for VSCode
A lightweight client for managing MariaDB, MySQL, SQL Server, PostgreSQL, SQLite, Interbase and Firebird, written in Delphi
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot