Нотатка
Доступ до цієї сторінки потребує авторизації. Можна спробувати ввійти або змінити каталоги.
Доступ до цієї сторінки потребує авторизації. Можна спробувати змінити каталоги.
Welcome to GitHub Copilot, your AI companion in SQL Server Management Studio (SSMS).
GitHub Copilot helps you write Transact-SQL (T-SQL) faster and with greater accuracy by suggesting new queries, updates to existing queries, answering questions, and assisting with administrator tasks, all directly in your SSMS environment.
In this article, you learn how to use GitHub Copilot and make the most of its features in SSMS.
Open GitHub Copilot
GitHub Copilot requires SQL Server Management Studio 22 or a later version. Update to the latest version of SSMS to access the latest updates and features.
Open SSMS and connect to a server or database in the query editor window.
Select the GitHub Copilot badge in the upper right corner of SSMS, and select Open Chat Window to Sign In.
If GitHub Copilot isn't installed, select Install Copilot from the GitHub Copilot badge, or open the Visual Studio Installer and modify your SSMS installation to add the AI Assistance workload. For more information, see Install GitHub Copilot in SQL Server Management Studio (Preview).
In the Chat window, sign in with your existing GitHub account or select Sign up for Copilot Free. Follow the prompts in your browser to complete the sign-in or sign-up process.
Once the process is complete, return to SSMS to start using Copilot.
Use GitHub Copilot
After you sign in, use the Chat window to interact with your database using natural language. You can ask general questions about SQL, questions specific to a database, or get assistance writing or editing T-SQL.
Note
Code Completions for GitHub Copilot are available in SSMS 22.2 and later versions.
- Use the Chat window to interact with your database using natural language. You can ask general questions about SQL, questions specific to a database, or get assistance writing or editing T-SQL.
- If you're not connected to a database in a query editor window, the context in the Chat window is the general Copilot. It can answer general SQL questions, but without a query editor connection it can't answer database specific questions.
- Open a query editor window and connect to a database. Within the Chat window, the database connection in the active editor window provides context for the prompt. GitHub Copilot in SSMS has knowledge of both the context (SQL version) and database (schema aware) from the database connection, so responses are tailored to your environment. As you navigate between open query editors, the context in the Chat window changes appropriately.
- Use Completions in the query editor. As you write T-SQL, Copilot provides suggestions directly in the editor. Copilot suggests both new code (shown as gray text) and edits to existing code.
Customize Copilot Chat
You can customize Copilot for your workflow and requirements in SSMS.
- Manage context with references: Use the + button to attach additional context, such as
.sqlfiles or.sqlplanfiles. - Access different models: Use the model picker in the prompt window to select AI models, or bring your own model to Copilot. Explore different models for different scenarios, whether it's answering quick questions, writing documentation, or generating code edits.
To review Copilot features at any time, select GitHub Copilot Walkthrough from the GitHub Copilot badge in the upper right corner of SSMS.
Support
Support for GitHub Copilot Chat is provided by GitHub.
To learn more about Copilot's security, privacy, compliance, and transparency, see the GitHub Copilot Trust Center FAQ and Responsible use of GitHub Copilot features.