Visual Studio Code SQL Server extension.
Перейти к файлу
Alex Hsu 719895f049
Juno: check in to lego/hb_8a5c857d-921a-4789-a5f2-d04520db775e_20230505154050765. (#17673)
2023-05-10 13:40:11 -07:00
.github Add CODEOWNERS (#17238) 2022-02-10 11:18:44 -08:00
.vscode Remove gulp-json-editor (#17584) 2023-03-07 14:06:27 -08:00
build Adjusts pipeline to include extension code signing (#17492) 2022-12-12 13:05:16 -08:00
images remove unused icon files (#1608) 2020-02-26 09:49:15 -08:00
lib/ads-adal-library MSAL Authentication support + code cleanup (#17562) 2023-03-02 17:53:36 -08:00
localization Juno: check in to lego/hb_8a5c857d-921a-4789-a5f2-d04520db775e_20230505154050765. (#17673) 2023-05-10 13:40:11 -07:00
media Fixing group by schema enabled icon (#17589) 2023-03-08 12:01:40 -08:00
samples updated sql2016-crud-demo (#1156) 2019-02-13 10:20:43 -08:00
snippets Update mssql.json (#1623) 2020-03-02 15:20:34 -08:00
src Validate server name before sending client request (#17676) 2023-05-09 13:42:12 -07:00
syntaxes Add LOG and REPLACE keywords to grammar (#17592) 2023-03-08 09:36:26 -08:00
tasks support linux-arm64 runtime (#17639) 2023-03-22 21:18:16 -07:00
test MSAL cache encryption support (#17625) 2023-03-16 16:34:48 -07:00
typings Fixing deleteDatabaseReference call (#17675) 2023-05-07 12:24:49 -07:00
.gitignore Includes ts files in coverage report (#17421) 2022-08-17 14:18:06 -07:00
.mention-bot Added mention-bot configuration settings (#479) 2016-12-07 16:33:14 -08:00
.vscodeignore Don't package unnecessary files (#17487) 2022-11-29 10:02:12 -08:00
CHANGELOG.md Update changelog for 1.18 release (#17635) 2023-03-20 14:50:10 -07:00
DEVELOPMENT.md Change publish to build in development docs (#17378) 2022-06-28 16:34:59 -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 Remove LGTM badge (#17663) 2023-04-26 12:37:53 -07: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 Remove gulp-json-editor (#17584) 2023-03-07 14:06:27 -08:00
gulpfile.js fix accessibility issues with query grid (#17479) 2022-11-18 14:29:08 -08:00
package.json updating version number post release branch split (#17679) 2023-05-08 11:17:45 -07:00
package.nls.json MSAL Authentication support + code cleanup (#17562) 2023-03-02 17:53:36 -08:00
tsconfig.json MSAL Authentication support + code cleanup (#17562) 2023-03-02 17:53:36 -08:00
tslint.json update sql projects/dacfx changes in vscode-mssql.d.ts (#17658) 2023-04-21 14:40:59 -07:00
tslint.mssdl.required.json Move rulesDirectory from JSON to tasks (#1225) 2019-04-23 17:43:40 -07:00
yarn.lock Update msal-node and bring latest httpClient changes (#17605) 2023-03-20 13:46:13 -07:00

README.md

Build Status Gitter

mssql for Visual Studio Code

Welcome to mssql for Visual Studio Code! An extension for developing Microsoft SQL Server, Azure SQL Database and SQL Data Warehouse everywhere with a rich set of functionalities, including:

  • Connect to Microsoft SQL Server, Azure SQL Database and SQL Data Warehouses.
  • Create and manage connection profiles and most recently used connections.
  • Write T-SQL script with IntelliSense, Go to Definition, T-SQL snippets, syntax colorizations, T-SQL error validations and GO batch separator.
  • Execute your scripts and view results in a simple to use grid.
  • Save the result to json or csv file format and view in the editor.
  • Customizable extension options including command shortcuts and more.

See the mssql extension tutorial for the step by step guide.

See the SQL developer tutorial to develop an app with C#, Java, Node.js, PHP, Python and R with SQL Server databases.

demo

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: Connnect 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
}

Change Log

See the change log for a detailed list of changes in each version.

Supported Operating Systems

Currently this extension supports the following operatings systems:

  • Windows (64-bit only)
  • macOS
  • 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

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.

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.