Wayback Machine
Nov DEC Jan
08
2019 2020 2021
success
fail
About this capture
COLLECTED BY
Collection: Save Page Now
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20201208125923/https://code.visualstudio.com/docs/languages/tsql
Skip to content 
Visual Studio Code
  • Docs
  • Updates
  • Blog
  • API
  • Extensions
  • FAQ
  • Learn
  • Search
  • Download
  • Search Search
  • Download VS Code Download VS Code Download

Version 1.51 is now available! Read about the new features and fixes from October.

Dismiss this update
'; document.body.appendChild(div.children[0]); }
  • Overview
  • Setup
    • Overview
    • Linux
    • macOS
    • Windows
    • Network
    • Additional Components
  • Get Started
    • Intro Videos
    • Tips and Tricks
    • User Interface
    • Themes
    • Settings
    • Key Bindings
    • Display Language
    • Telemetry
  • User Guide
    • Basic Editing
    • Extension Marketplace
    • IntelliSense
    • Code Navigation
    • Refactoring
    • Debugging
    • Version Control
    • Working with GitHub
    • Integrated Terminal
    • Tasks
    • Settings Sync
    • Snippets
    • Emmet
    • Command Line
    • Multi-root Workspaces
    • Accessibility
  • Languages
    • Overview
    • JavaScript
    • JSON
    • HTML
    • CSS, SCSS and Less
    • TypeScript
    • Markdown
    • PowerShell
    • C++
    • Java
    • PHP
    • Python
    • Go
    • T-SQL
    • C#
    • .NET Core
  • Node.js / JavaScript
    • Working with JavaScript
    • Node.js Tutorial
    • Node.js Debugging
    • Node.js Deployment
    • React Tutorial
    • Angular Tutorial
    • Vue Tutorial
    • Ember Tutorial
    • Debugging Recipes
    • Extensions
  • TypeScript
    • Tutorial
    • Compiling
    • Debugging
  • Python
    • Tutorial
    • Editing Code
    • Linting
    • Debugging
    • Environments
    • Testing
    • Jupyter Notebook Support
    • Python Interactive
    • Data Science Tutorial
    • Django Tutorial
    • Flask Tutorial
    • Create containers
    • Python on Azure
    • Settings Reference
  • Java
    • Getting Started
    • Navigate and Edit
    • Refactoring
    • Linting
    • Project Management
    • Build Tools
    • Run and Debug
    • Testing
    • Spring Boot
    • Application Servers
    • Java on Azure
    • Extensions
    • FAQ
  • C++
    • GCC on Linux
    • GCC on Windows
    • GCC on Windows Subsystem for Linux
    • Clang on macOS
    • Microsoft C++ on Windows
    • CMake Tools on Linux
    • Debugging
    • Editing
    • Settings
    • Configure IntelliSense for cross-compiling
    • FAQ
  • Containers
    • Overview
    • Node.js
    • Python
    • ASP.NET Core
    • Debug
    • Docker Compose
    • Registries
    • Deploy to Azure
    • Choose a dev environment
    • Customize
    • Develop with Kubernetes
  • Azure
    • Extensions
    • Deployment
    • Remote Debugging for Node.js
    • Docker
    • MongoDB
    • Kubernetes
  • Remote
    • Overview
    • SSH
    • Containers
    • Windows Subsystem for Linux
    • GitHub Codespaces
    • SSH Tutorial
    • Containers Tutorial
    • WSL Tutorial
    • Attach to Container
    • Create a Dev Container
    • Advanced Containers
    • devcontainer.json
    • Tips and Tricks
    • FAQ

Topics

Transact-SQL in Visual Studio Code

Turn Visual Studio Code into a powerful editor for Transact-SQL (T-SQL) development, with the mssql extension available in the VS Code Marketplace. The mssql extension is optimized to work with SQL Server running on-premises, in any cloud, Azure SQL Database, and Azure SQL Data Warehouse.

Connect to SQL databases, type T-SQL code, execute T-SQL code, view results, and save results as JSON or CSV files. While typing T-SQL code, you get rich T-SQL language features like T-SQL IntelliSense (code completion), syntax highlighting, linting, code navigation and code snippets.

Download VS Code - If you haven't downloaded VS Code yet, quickly install for your platform (Linux, macOS or Windows).

Install T-SQL support

Add T-SQL language support to VS Code by installing the mssql extension from the VS Code marketplace as follows:

  1. Open the Extensions view from VS Code Side Bar (⇧⌘X (Windows, Linux Ctrl+Shift+X)).
  2. Type "mssql" in the search bar, click Install, and reload VS Code when prompted.

install mssql extension

Connect and Execute T-SQL

Easily connect to SQL Server running on-premises, in any cloud, Azure SQL Database, and Azure SQL Data Warehouse. Then, execute your T-SQL statements and batches to view results and messages - all within VS Code. Your recent connections are saved across sessions, so you can quickly connect to your databases again.

execute tsql

View and Save Results

View results and messages when you execute your T-SQL code. Save results as a JSON or CSV file to use the data in your applications with just a few clicks.

save tsql

T-SQL IntelliSense

As you type T-SQL code in the editor, VS Code provides intelligent code completion for T-SQL keywords, suggestions for schema object names (tables, columns, views), and parameter help for functions and procedures when connected to a database.

tsql intellisense

Linting

Linting is the analysis of your T-SQL code for potential syntax errors. Use Visual Studio Code to quickly navigate to the errors and warnings in your T-SQL code as you type.

tsql linting

Peek Definition/Go to Definition

Use Peek Definition or Go to Definition to quickly browse the definition of schema objects in your database such as tables, functions, and procedures while typing T-SQL code.

tsql peek definition

Snippets

T-SQL snippets provide code templates for commonly used T-SQL statements. Type "sql" to get the list of T-SQL snippets.

tsql snippets

Next steps

  • Download the free SQL Server 2017 Developer Edition.
  • Install the mssql extension from the Visual Studio Code Marketplace.
  • Build an app using SQL Server - Get started with SQL Server on macOS, Linux, and Windows using your favorite programming language.
  • Contribute to the mssql extension on GitHub. Submit a bug report or a feature suggestion on our GitHub Issue Tracker.

Further Reading

  • SQL Server documentation
  • SQL Server on Linux documentation
  • SQL Server Blog
  • SQL Server Videos on Channel9
1/24/2017

In this article there are 9 sectionsIn this article

  • Install T-SQL support
  • Connect and Execute T-SQL
  • View and Save Results
  • T-SQL IntelliSense
  • Linting
  • Peek Definition/Go to Definition
  • Snippets
  • Next steps
  • Further Reading
  • Hello from Seattle.
  • Follow @code
  • Support
  • Privacy
  • Manage Cookies
  • Terms of Use
  • License
Microsoft homepage Microsoft homepage © 2020 Microsoft