Visual Studio Code SQL Server extension.
Перейти к файлу
CSIGS@microsoft.com 5e6ee2ac80
Juno: check in to lego/hb_8a5c857d-921a-4789-a5f2-d04520db775e_20241118164218361. (#18434)
2024-11-18 11:09:24 -08:00
.github Fixing test coverage by adding more report types and updating to nyc from Istanbul (#18309) 2024-10-23 17:12:31 -07:00
.husky Eslint improvements. (#18086) 2024-09-26 13:37:49 -07:00
.vscode Remove watch prelaunch command (#18291) 2024-10-21 17:07:26 -07:00
build Fixing test coverage by adding more report types and updating to nyc from Istanbul (#18309) 2024-10-23 17:12:31 -07:00
images Adding feature page (#18306) 2024-10-23 09:29:05 -07:00
localization Juno: check in to lego/hb_8a5c857d-921a-4789-a5f2-d04520db775e_20241118164218361. (#18434) 2024-11-18 11:09:24 -08:00
media Added enable/disable actual plan for query plans (#18345) 2024-11-06 09:59:24 -08:00
samples updated sql2016-crud-demo (#1156) 2019-02-13 10:20:43 -08:00
snippets Remove sqlDropStoredProc snippet which conflicts with DESC keyword (#18319) 2024-10-25 18:03:52 -07:00
src not blocking the results pop-out on the prompt response (#18429) 2024-11-15 17:29:07 -08:00
syntaxes Add grammar readme (#17851) 2023-12-13 13:59:02 -08:00
tasks Fixing test coverage by adding more report types and updating to nyc from Istanbul (#18309) 2024-10-23 17:12:31 -07:00
test Fixing test coverage by adding more report types and updating to nyc from Istanbul (#18309) 2024-10-23 17:12:31 -07:00
typings Add basic WebviewView-based query result panel (#18041) 2024-09-16 10:33:31 -07:00
.gitignore Eslint improvements. (#18086) 2024-09-26 13:37:49 -07:00
.mention-bot Added mention-bot configuration settings (#479) 2016-12-07 16:33:14 -08:00
.vscode-test.mjs Enabling test explorer for unit tests. (#18218) 2024-10-15 21:26:02 -07:00
.vscodeignore Adding feature page (#18306) 2024-10-23 09:29:05 -07:00
CHANGELOG.md changelog for 1.26 (#18426) 2024-11-15 17:01:37 -08:00
DEVELOPMENT.md Change publish to build in development docs (#17378) 2022-06-28 16:34:59 -07:00
FEATURES.md Adding feature page (#18306) 2024-10-23 09:29:05 -07:00
KERBEROS_HELP.md Update KERBEROS_HELP.md (#1072) 2018-03-16 10:22:27 -07:00
LICENSE.txt Product changes (#1547) 2019-12-16 13:18:08 -08:00
README.md update readme for 1.26.0 (#18425) 2024-11-15 16:56:20 -08:00
SECURITY.md Microsoft mandatory file (#17336) 2022-05-16 15:06:30 -07:00
ThirdPartyNotices.txt Product changes (#1547) 2019-12-16 13:18:08 -08:00
coverconfig.json Move tests into dedicated subfolder (#17913) 2024-06-28 12:58:31 -07:00
eslint.config.mjs upgrades floating promises to explicit `void` (#18141) 2024-10-07 11:19:08 -07:00
gulpfile.js Fixing test coverage by adding more report types and updating to nyc from Istanbul (#18309) 2024-10-23 17:12:31 -07:00
package.json Add a separate flag for new query result feature (#18404) 2024-11-14 15:26:56 -08:00
package.nls.json Add a separate flag for new query result feature (#18404) 2024-11-14 15:26:56 -08:00
playwright.config.ts Adding daily build and test status to readme and publish test reports and coverage (#17957) 2024-08-01 16:38:46 -07:00
prettier.config.mjs Eslint fixes (#18045) 2024-09-17 15:37:02 -07:00
tsconfig.json New UI based add connection (#17939) 2024-07-25 11:05:10 -07:00
tsconfig.react.json New UI based add connection (#17939) 2024-07-25 11:05:10 -07:00
yarn.lock Bump @eslint/plugin-kit from 0.2.0 to 0.2.3 (#18420) 2024-11-15 14:45:09 -08:00

README.md

Daily Build and Test Gitter

mssql for Visual Studio Code

This extension is designed to help developers seamlessly work with their databases, making it easier to use SQL Server or any Azure SQL service (including Azure SQL Database, Azure SQL Managed Instance, and SQL Server on Azure VMs) as the backend for their applications. With a rich set of features, mssql for Visual Studio Code enhances the development experience, offering functionalities such as:

  • Connect to Microsoft SQL Server and Azure SQL Database: Seamlessly connect to your databases to manage and query data. The new Connection Dialog (Preview) offers a more intuitive interface, with options for entering parameters, connection strings, or browsing Azure databases. The Recent Connections panel provides quick access to previously used servers.
  • Create and manage connection profiles: Easily manage multiple connection profiles and quickly reconnect using your most recently used connections.
  • 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.
  • Execute queries and View Results (Preview): 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.
    • View estimated plan and actual plan for T-SQL queries.
  • Object Explorer (Preview): Navigate through your database objects, such as databases, tables, views, and programmability items. Enhanced filtering allows you to filter database objects by properties like name, owner, or creation date, making it easier to locate specific objects within large database hierarchies.
  • Table Designer (Preview): 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.
    • Script As Create: Automatically generate T-SQL scripts for your table design and apply changes directly to the database.
  • Query Plan Visualizer (Preview): Analyze SQL query performance with detailed execution plans. Key features include:
    • Node Navigation: Interact with each step in the execution plan, including collapsing or expanding nodes for a simplified view.
    • Zoom Controls: Zoom in or out to adjust the level of detail, or use "zoom to fit" for a complete view of the plan.
    • Metrics and Highlighting: 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.
demo

Get started today and experience a streamlined SQL development workflow with mssql for Visual Studio Code!

Using

  • First, install Visual Studio Code then install mssql extension by pressing F1 or ctrl+shift+p to open command palette, select Install Extension and type mssql.
  • Open an existing file with a .sql file extension or open a new text file (ctrl+n) and change the language mode to SQL by pressing ctrl+k,m and select SQL. mssql commands and functionalities are enabled in the SQL language mode in Visual Studio Code editor.
  • Create a new connection profile using command palette by pressing F1, type sqlman to run MS SQL: Manage Connection Profile command. Select Create. See manage connection profiles for more information about how to create and edit connection profiles in your User Settings (settings.json) file.
  • Connect to a database by pressing F1 and type sqlcon to run MS SQL: Connect command, then select a connection profile. You can also use a shortcut (ctrl+shift+c).
  • Write T-SQL script in the editor using IntelliSense and Snippets. Type sql in the editor to list T-SQL Snippets.
  • Execute T-SQL script or selection of statements in the script by pressing F1 and type sqlex to run MS SQL: Execute Query command. You can also use a shortcut (ctrl+shift+e). See customize shortcuts to learn about change shortcut key bindings to mssql commands.
  • View the T-SQL script execution results and messages in result view.

Commands

The extension provides several commands in the Command Palette for working with .sql files:

  • 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.

Options

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). See customize options and manage connection profiles for more details.

{
    "mssql.maxRecentConnections": 5,
    "mssql.connections":[],
    "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": ""
    },
    "mssql.messagesDefaultOpen": true,
    "mssql.logDebugInfo": false,
    "mssql.saveAsCsv.includeHeaders": true,
    "mssql.saveAsCsv.delimiter": ",",
    "mssql.saveAsCsv.lineSeparator": null,
    "mssql.saveAsCsv.textIdentifier": "\"",
    "mssql.saveAsCsv.encoding": "utf-8",
    "mssql.intelliSense.enableIntelliSense": true,
    "mssql.intelliSense.enableErrorChecking": true,
    "mssql.intelliSense.enableSuggestions": true,
    "mssql.intelliSense.enableQuickInfo": true,
    "mssql.intelliSense.lowerCaseSuggestions": false,
    "mssql.resultsFontFamily": "-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif",
    "mssql.resultsFontSize": 13,
    "mssql.copyIncludeHeaders": false,
    "mssql.copyRemoveNewLine" : true,
    "mssql.splitPaneSelection": "next",
    "mssql.format.alignColumnDefinitionsInColumns": false,
    "mssql.format.datatypeCasing": "none",
    "mssql.format.keywordCasing": "none",
    "mssql.format.placeCommasBeforeNextStatement": false,
    "mssql.format.placeSelectStatementReferencesOnNewLine": false,
    "mssql.applyLocalization": false,
    "mssql.query.displayBitAsNumber": true,
    "mssql.persistQueryResultTabs": false,
    "mssql.enableRichExperiences": true,
    "mssql.openQueryResultsInTabByDefault": false
    "mssql.enableNewQueryResultsFeature": false
}

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 on our GitHub Issue Tracker. 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.