Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 612534e

Browse files
authored
SSMS 22 preview release (#618)
1 parent 0feb2cd commit 612534e

21 files changed

Lines changed: 1009 additions & 25 deletions

ssms/TOC.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,31 @@ items:
7878
- name: User assistance in SSMS
7979
href: user-assistance-in-sql-server-management-studio.md
8080

81+
- name: GitHub Copilot in SQL Server Management Studio (SSMS) (Preview)
82+
items:
83+
- name: What is GitHub Copilot in SSMS (Preview)?
84+
href: github-copilot/overview.md
85+
- name: Get started with GitHub Copilot in SSMS (Preview)
86+
href: github-copilot/get-started.md
87+
- name: Chat
88+
items:
89+
- name: Ask mode
90+
href: github-copilot/chat.md
91+
- name: Chat context
92+
href: github-copilot/chat-context.md
93+
- name: Account
94+
items:
95+
- name: Install GitHub Copilot in SSMS
96+
href: github-copilot/installation-state.md
97+
- name: Use GitHub Copilot for free
98+
href: github-copilot/free-plan.md
99+
- name: Scenarios
100+
href: github-copilot/scenarios.md
101+
- name: Best practices
102+
href: github-copilot/best-practices.md
103+
- name: Troubleshoot GitHub Copilot in SSMS
104+
href: github-copilot/troubleshoot.md
105+
81106
- name: Copilot in SQL Server Management Studio (SSMS) (Preview)
82107
items:
83108
- name: Overview of Copilot in SSMS (Preview)
@@ -97,6 +122,15 @@ items:
97122
- name: Troubleshooting
98123
href: copilot/copilot-in-ssms-troubleshooting.md
99124

125+
- name: Query Hint Recommendation tool (Preview)
126+
items:
127+
- name: Overview of the Query Hint Recommendation tool (Preview)
128+
href: query-hint-tool/hint-tool-overview.md
129+
- name: Install the Query Hint Recommendation tool (Preview)
130+
href: query-hint-tool/hint-tool-install.md
131+
- name: Use the Query Hint Recommendation tool (Preview)
132+
href: query-hint-tool/hint-tool-use.md
133+
100134
- name: Connect and query
101135
items:
102136
- name: Connect with SQL Server Management Studio

ssms/copilot/copilot-in-ssms-install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ description: Learn how to install Copilot in SQL Server Management Studio.
55
author: erinstellato-ms
66
ms.author: erinstellato
77
ms.reviewer: randolphwest
8-
ms.date: 07/28/2025
9-
ms.update-cycle: 180-days
8+
ms.date: 10/07/2025
109
ms.service: sql-server-management-studio
1110
ms.topic: concept-article
1211
ms.collection:
12+
- data-tools
1313
- ce-skilling-ai-copilot
14+
ms.update-cycle: 180-days
1415
# CustomerIntent: As a database administrator or database developer, I want to understand how to install Copilot in SQL Server Management Studio.
1516
---
1617

@@ -23,7 +24,7 @@ Copilot in SQL Server Management Studio (SSMS) is your AI assistant that can ans
2324
To use Copilot in SSMS, you need:
2425

2526
- [!INCLUDE [ssms-21-md](../includes/ssms-21-md.md)]
26-
- An endpoint and deployment in [Azure OpenAI Service](/azure/ai-services/openai/overview)
27+
- An endpoint and deployment in [Azure OpenAI in Azure AI Foundry](/azure/ai-services/openai/overview)
2728

2829
[!INCLUDE [ssms-21-md](../includes/ssms-21-md.md)] is the GA version of SQL Server Management Studio (SSMS). For information related to SSMS 21 installation, see [Install SQL Server Management Studio](../install/install.md).
2930

@@ -63,12 +64,11 @@ You can remove Copilot in SSMS from your SSMS installation using the Visual Stud
6364
1. Select the installation of SSMS from you want to remove Copilot in SSMS, then select **Modify**.
6465
1. Uncheck **AI Assistance** on the Workloads tab.
6566
1. Select **Modify** to uninstall the extension.
66-
1. Restart SSMS.
6767

6868
## Related content
6969

7070
- [Troubleshooting issues with Copilot in SQL Server Management Studio](copilot-in-ssms-troubleshooting.md)
71-
- [What is Azure OpenAI Service?](/azure/ai-services/openai/overview)
71+
- [What is Azure OpenAI in Azure AI Foundry Models?](/azure/ai-services/openai/overview)
7272
- [Use Azure OpenAI with Copilot in SSMS](use-azure-openai-with-copilot-in-ssms.md)
7373
- [Use the chat window for Copilot in SQL Server Management Studio](copilot-in-ssms-chat.md)
7474
- [Code assistance for Copilot in SQL Server Management Studio](copilot-in-ssms-code-assistance.md)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Best Practices
3+
titleSuffix: GitHub Copilot in SQL Server Management Studio
4+
description: Learn about best practices for using GitHub Copilot in SQL Server Management Studio (SSMS).
5+
author: erinstellato-ms
6+
ms.author: erinstellato
7+
ms.reviewer: randolphwest
8+
ms.date: 10/14/2025
9+
ms.service: sql-server-management-studio
10+
ms.topic: how-to
11+
ms.collection:
12+
- ce-skilling-ai-copilot
13+
ms.update-cycle: 180-days
14+
# CustomerIntent: As a database administrator or database developer, I want to understand the best practices to optimize my use of Copilot in SQL Server Management Studio.
15+
---
16+
# Best practices for GitHub Copilot in SQL Server Management Studio (Preview)
17+
18+
GitHub Copilot in SQL Server Management Studio (SSMS) accelerates your productivity within your workflow in SSMS, including writing and editing Transact-SQL (T-SQL). To get the most out of GitHub Copilot in SSMS, you should learn how to collaborate with it effectively. Like any partner, GitHub Copilot in SSMS performs best when given clear direction and appropriate context. Optimal use of the chat window also enhances the quality of your experience with GitHub Copilot in SSMS.
19+
20+
## Chat window
21+
22+
The icons and capabilities of the chat window are documented in [Use the GitHub Copilot Chat experience in SQL Server Management Studio (Preview)](chat.md), but there are other considerations specific to prompts.
23+
24+
Primarily, don't treat the chat window as a results window. When you ask GitHub Copilot questions about your schema or data, it might directly execute a query to return information to you in the chat window. GitHub Copilot in SSMS doesn't determine the number of rows returned by a query before it executes, and if the query returns 1,000 rows, it tries to display that information in the chat. Large result sets aren't easily readable, and can't be manipulated, within the chat window.
25+
26+
Asking GitHub Copilot in SSMS to write the query to return the information is often preferred, and creates a better interaction and experience with GitHub Copilot.
27+
28+
## Consistency
29+
30+
A common frustration among users of copilots is an inconsistency in responses. AI responses can be inconsistent because they're generated probabilistically rather than deterministically. This means that even when asked the same question, the model might choose a different, but still plausible, set of words or sentence structure based on subtle variations in context, configuration, or internal randomness. Additionally, AI models weigh many potential interpretations of a prompt, so small changes in phrasing or timing can lead to different outcomes. This variability is part of what makes AI so flexible and powerful, but it can also lead to unpredictable results if prompts aren't optimally constructed.
31+
32+
## Prompt writing
33+
34+
Inherent in working with AI is writing prompts to submit, and just like performance tuning, it's an art and a science. You don't need to be a prompt engineer to write good prompts. But you do need to be aware of general guidelines when engaging with AI.
35+
36+
As an example, if you ask `Find the hottest tables in the database`, GitHub Copilot in SSMS might not understand that in the context of this prompt, the hottest tables are those tables that are the busiest, or most active. Instead, try `List the top 10 tables in the database that have the most reads`.
37+
38+
General recommendations for prompt writing include:
39+
40+
| Recommendation | Details |
41+
| --- | --- |
42+
| **Use natural language** | You don't need to use specialized vocabulary, but try to avoid informal phrases, slang, and jargon. |
43+
| **Be clear and specific** | Provide enough detail so GitHub Copilot is clear about what you're asking. |
44+
| **Provide context** | GitHub Copilot in SSMS has connection and database context based on the query editor connection, but you can provide extra context such as a timeframe, or specific database objects. |
45+
| **Use examples** | Build on previous responses, such as `Modify the last query to order the results by CustomerID`. |
46+
| **Define the output format** | GitHub Copilot can provide information in text, table, or list format. It chooses for you, but you can specifically ask for information to be returned in a desired format. |
47+
48+
Example prompts:
49+
50+
| Recommendation | Avoid | Try |
51+
| --- | --- | --- |
52+
| **Use natural language** | `Yo cook me up something cool for grabbing sales data` | `Write a SQL query that selects the top 10 most recent orders from the Sales.Orders table` |
53+
| **Be clear and specific** | `Okay, so I've got this thing where I need to maybe get some kind of report or output or whatever for yesterday's stuff but like only for users that are new but not too new, if that makes sense` | `Write a query to return users who registered yesterday and have not yet made a purchase` |
54+
| **Provide context** | `List western schools with no language reqs` | `List schools in the US-West geo that have a lang_req value of 0` |
55+
| **Use examples** | `Write a query to get recent customer info` | `Write a query to get customer ID, name, and total number of orders for the last 10 business days ordered by total desc` |
56+
| **Define the output format** | `Give me hospital locations and size with the busiest emergency rooms` | `List the hospitals with the busiest emergency rooms in table format and include city state and size` |
57+
58+
## Related content
59+
60+
- [Use the GitHub Copilot Chat experience in SQL Server Management Studio (Preview)](chat.md)
61+
- [Scenarios for GitHub Copilot in SQL Server Management Studio (Preview)](scenarios.md)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Chat Context
3+
titleSuffix: GitHub Copilot in SQL Server Management Studio (Preview)
4+
description: Learn how to add context for GitHub Copilot in SQL Server Management Studio.
5+
author: erinstellato-ms
6+
ms.author: erinstellato
7+
ms.reviewer: randolphwest
8+
ms.date: 10/14/2025
9+
ms.service: sql-server-management-studio
10+
ms.topic: concept-article
11+
ms.collection:
12+
- ce-skilling-ai-copilot
13+
ms.update-cycle: 180-days
14+
# CustomerIntent: As a database administrator or database developer, I want to understand how to add context for GitHub Copilot in SQL Server Management Studio.
15+
---
16+
17+
# Add context for GitHub Copilot in SQL Server Management Studio (Preview)
18+
19+
Add more context to your prompts in GitHub Copilot in SQL Server Management Studio (SSMS) by using references, in addition to its contextual knowledge, to obtain better responses.
20+
21+
## Use slash commands for code assistance
22+
23+
GitHub Copilot in SQL Server Management Studio (SSMS) offers code assistance to help you set the intent for common database development tasks. This intent can accelerate productivity to help you understand and fix queries faster. Highlight any query in the editor and use the slash commands to document, explain, fix, or optimize the query. The slash commands are available in both the chat window and inline chat.
24+
25+
| Command | Usage |
26+
| --- | --- |
27+
| `/doc` | Add comments for selected T-SQL code to help the next person who looks at your code understand what you did. |
28+
| `/explain` | Get in-depth details about the selected T-SQL code. |
29+
| `/fix` | Address errors in the T-SQL code and return a correct version to review, including an explanation of the issue and what was changed. |
30+
| `/help` | Get help on using Copilot Chat. |
31+
| `/optimize` | Identify anti-patterns in the query and make changes consistent with T-SQL best practices |
32+
33+
## Reference other files
34+
35+
You can ask your T-SQL related questions in natural language and GitHub Copilot Chat answers in the context of active editor in SSMS. References provide specific information you want Copilot to consider when answering your question.
36+
37+
By selecting other files open in the editor, you might be able to form better questions without having to write out or paste long pieces of information. Specifying the context also enables Copilot to provide you with more relevant answers.
38+
39+
To reference a file in GitHub Copilot Chat, add a # symbol at the beginning of the file name. For example, if you have a file named `GetSalesInfo.sql`, refer to it in the chat as `#GetSalesInfo.sql`.
40+
41+
## Manage chat history context with threads
42+
43+
As you iterate and send multiple chat prompts in a chat session, Copilot uses the history of chat prompts and responses. The previous prompts and responses provide context to your current chat prompt. This means that you can ask follow-up questions or clarify your previous question without having to repeat the context. For example, you can ask "How do I change the compatibility mode?", "What are the differences between compatibility mode 140 and 170?", "What do I need to consider when changing compatibility mode?", and more.
44+
45+
To start over with a new chat session and discard the current context, start a new thread in the chat view. New threads are useful when you want to move to a different topic and avoid the previous context and history. Use threads to keep conversations focused on the task at hand, and keep the context clear so the answers are based on relevant history.
46+
47+
### New chat thread
48+
49+
Select **Create new thread** or **Ctrl** + **N** in the chat window to start a new thread.
50+
51+
### Switch chat thread
52+
53+
You can toggle between multiple ongoing threads to provide the right historical context for your question. Use **Ctrl** + **PgDown** for previous thread or **Ctrl** + **PgUp** for next thread in the chat window. **Ctrl** + **Shift** + **T** expands the thread dropdown list.
54+
55+
### Preserve the inline chat
56+
57+
To preserve the history of your inline chat, promote it to the chat window. Select **View in chat window** to maintain a record and context of the conversation, and continue in the chat window.
58+
59+
## Best practices
60+
61+
Copilot Chat uses the chat history to get context about your request. To give Copilot only the relevant history:
62+
63+
- Use threads to start a new conversation for a new task.
64+
- Delete requests that are no longer relevant or that didn't give you the desired result.
65+
66+
Keep the chat conversation open and continue to iterate and prompt Copilot to improve the suggested solution. Copilot has both the context of the generated code and your current conversation history. As you keep asking questions, Copilot further refines the response according to your requirements.
67+
68+
## Related content
69+
70+
- [Get started with GitHub Copilot in SQL Server Management Studio (Preview)](get-started.md)
71+
- [Scenarios for GitHub Copilot in SQL Server Management Studio (Preview)](scenarios.md)

ssms/github-copilot/chat.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Ask Mode
3+
titleSuffix: GitHub Copilot in SQL Server Management Studio (Preview)
4+
description: Learn how to use the GitHub Copilot Chat experience in SQL Server Management Studio (SSMS).
5+
author: erinstellato-ms
6+
ms.author: erinstellato
7+
ms.reviewer: randolphwest
8+
ms.date: 10/14/2025
9+
ms.service: sql-server-management-studio
10+
ms.topic: how-to
11+
ms.collection:
12+
- ce-skilling-ai-copilot
13+
ms.update-cycle: 180-days
14+
# CustomerIntent: As a database administrator or database developer, I want to understand how to use GitHub Copilot Chat in SQL Server Management Studio.
15+
---
16+
# Use the GitHub Copilot Chat experience in SQL Server Management Studio (Preview)
17+
18+
The Chat window for GitHub Copilot in SQL Server Management Studio (SSMS) enables enhanced AI-assisted database administration and development in SSMS, helping you be more productive and efficient when working with your SQL database.
19+
20+
In this article, you learn about using GitHub Copilot Chat in SSMS, a fully integrated AI-powered chat experience from GitHub Copilot that exists directly in SSMS. It enables you to get Transact-SQL (T-SQL) support, including syntax and context-specific help, without leaving the SSMS UI. Use the chat interface to submit your question as prompt and provide intent for better scoped answers.
21+
22+
## Why use GitHub Copilot Chat in SSMS?
23+
24+
GitHub Copilot Chat provides AI assistance to help you make informed decisions about your SQL database and write better T-SQL faster. With an integration in SSMS that includes connection context and schema understanding, GitHub Copilot Chat understands what you're working on and can help with tasks including:
25+
26+
- T-SQL assistance:
27+
28+
- Get context-specific code suggestions and recommendations
29+
- Understand and document what a query does
30+
- Get assistance fixing syntax errors in your query
31+
- Refactor queries
32+
33+
- Database administration:
34+
35+
- Get help managing settings, security, and more
36+
- Configure and monitor database maintenance
37+
- Implement new SQL features
38+
39+
- Database development:
40+
41+
- Schema design
42+
- Data type selection
43+
- Indexing recommendations
44+
45+
## Prerequisites
46+
47+
To use GitHub Copilot Chat in SSMS, you need SSMS 22 (Preview) or higher, and a GitHub account with [Copilot access](https://docs.github.com/copilot/get-started/what-is-github-copilot#getting-access-to-copilot). Otherwise, you can use [Use GitHub Copilot for free in SQL Server Management Studio (Preview)](free-plan.md).
48+
49+
## Use Copilot Chat in SSMS
50+
51+
Ask database and T-SQL questions in natural language and GitHub Copilot Chat will answer them in the context of your database and its connection.
52+
53+
There are two places you can ask Copilot these questions; in the chat window, or directly inline in the code that you're looking to modify, using inline chat. For questions where your goal is to modify or add to the SQL file you have open in the editor, the inline chat view might work best, whereas more general T-SQL questions are best answered in the chat pane.
54+
55+
See tips to improve Copilot chat results to learn how to use [slash commands](chat-context.md#use-slash-commands-for-code-assistance), [reference files](chat-context.md#reference-other-files), and [threads](chat-context.md#manage-chat-history-context-with-threads) to get better answers with scoped context in Copilot Chat.
56+
57+
### Ask questions in the chat window
58+
59+
The chat window of Copilot Chat in SSMS enables you to ask your questions and see answers in the chat pane. It's usually the preferred way to work with Copilot for database help and general T-SQL questions.
60+
61+
1. Open a query editor window and connection to your database.
62+
1. In SSMS, select **View** > **GitHub Copilot Chat**.
63+
1. Use the example starter prompts in the chat window to start exploring Copilot Chat, or type in a prompt and select **Enter** or **Send** to submit your question.
64+
1. If Copilot Chat offers a T-SQL suggestion you want to use, select **Apply** to apply the code to the active query editor, **Copy code block** to copy the suggestion, or **Add to new file** to insert the code suggestion in a new file.
65+
- If you ask for help with understanding your code, the **Insert in new file** option isn't available.
66+
1. If you select **Apply**, the code suggestion is applied to the active editor in the diff view pattern. You can review and refine what is being proposed and apply it using **Tab**, or discard it using **Alt** + **Delete**.
67+
68+
### Ask questions in the inline chat view
69+
70+
The inline chat view of Copilot Chat in SSMS enables you to ask your questions and see answers inline with the code directly in the editor window. With inline chat, you don't have to go back and forth to the chat window. You might find it easier to work with Copilot on questions that add to or update a currently open SQL file using inline chat.
71+
72+
1. In SSMS, select **Alt** + **/** to bring up the inline chat view of Copilot Chat in the editor.
73+
1. Type your T-SQL related question in the Ask Copilot text box, and then select **Enter** or **Send** to ask your question.
74+
1. Code suggestions from Copilot Chat appear in the diff view. You can review and refine what is being proposed and apply the change to your code using **Tab**, or discard it using **Alt** + **Delete**.
75+
1. You can promote your inline chat thread to the chat window by selecting **View in chat window**. This preserves the record and context of your conversation, and you can continue in the chat window.
76+
1. Select **Esc** to close the inline chat view.
77+
78+
## Related content
79+
80+
- [Get started with GitHub Copilot in SQL Server Management Studio (Preview)](get-started.md)
81+
- [Add context for GitHub Copilot in SQL Server Management Studio (Preview)](chat-context.md)
82+
- [Troubleshoot GitHub Copilot in SQL Server Management Studio (Preview)](troubleshoot.md)

0 commit comments

Comments
 (0)