You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tools/visual-studio-code-extensions/github-copilot/agent-mode.md
+24-20Lines changed: 24 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to use GitHub Copilot Agent Mode with the MSSQL extension
5
5
author: croblesm
6
6
ms.author: roblescarlos
7
7
ms.reviewer: randolphwest
8
-
ms.date: 11/18/2025
8
+
ms.date: 01/19/2026
9
9
ms.service: sql
10
10
ms.subservice: vs-code-sql-extensions
11
11
ms.topic: quickstart
@@ -19,16 +19,20 @@ ai-usage: ai-assisted
19
19
20
20
# Quickstart: Use GitHub Copilot Agent Mode
21
21
22
-
GitHub Copilot Agent Mode brings a contextual, action-driven chat experience into the MSSQL extension for Visual Studio Code. With Agent Mode, GitHub Copilot can go beyond suggesting code—it can securely execute real database tasks using natural language prompts or built-in tools. You can list all your connections, connect to specific server/databases, and explore schemas without leaving your editor.
22
+
Agent Mode allows GitHub Copilot to use the tools available in the MSSQL extension for Visual Studio Code. When the extension is installed and active, Copilot can list SQL Server connections, connect to a server and database, and retrieve database metadata.
23
+
24
+
All actions use the same connection context and credentials as the MSSQL extension. Agent Mode doesn't introduce additional authentication or permission changes.
23
25
24
26
> [!TIP]
25
-
> You don't need to mention a participant like `@mssql` to use SQL tools in Agent Mode. Once the MSSQL extension is active, its tools are automatically available in the Agent Mode interface. For more information, see [Agent Mode Tools](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
27
+
> You don't need to reference the MSSQL extension (`@mssql`) explicitly when using Agent Mode. If the extension is active, its tools are available automatically. For more information, see [Agent Mode Tools](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
26
28
27
-
These actions are powered by tools contributed by the MSSQL extension and surfaced directly within GitHub Copilot's Agent Mode. For more information on how Agent Mode works, see the [Visual Studio Code documentation on Agent Mode](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
29
+
For details about how Agent Mode selects and executes tools, see the [Visual Studio Code documentation on Agent Mode](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
28
30
29
31
## What is Agent Mode?
30
32
31
-
Agent Mode enables GitHub Copilot to go beyond suggesting code. It can now perform secure, confirmed actions inside your SQL development environment, using either chat variables like `#mssql_connect`, or natural phrases like:
33
+
Agent Mode lets GitHub Copilot perform SQL-related actions using the MSSQL extension, and user confirmation is required before execution.
34
+
35
+
You can invoke these actions by using chat variables such as `#mssql_connect`, or by issuing equivalent natural-language requests, for example:
32
36
33
37
```copilot-prompt
34
38
Connect to my Library database using my LocalDev profile
| `connect` | Establishes a database connection using a saved connection profile or a specified server/database pair. |
59
-
| `disconnect` | Terminates the current active connection session. |
62
+
| `connect` | Connects to a database by using a saved connection profile or a specified server and database. |
63
+
| `disconnect` | Ends the current active connection session. |
60
64
| `change_database` | Changes the database for an existing connection session. |
61
65
| `get_connection_details` | Gets connection details for a specific MSSQL connection. |
62
66
| `list_servers` | Lists all saved SQL Server connection profiles in your environment. |
63
67
| `list_databases` | Lists all available databases for a connected MSSQL server. |
64
68
65
69
#### Examples
66
70
67
-
The following phrases can be used to interact with GitHub Copilot.
71
+
Use the following phrases to interact with GitHub Copilot.
68
72
69
73
```copilot-prompt
70
74
- Connect to my LocalDev environment
@@ -80,15 +84,15 @@ The following phrases can be used to interact with GitHub Copilot.
80
84
81
85
#### How connection logic works
82
86
83
-
GitHub Copilot Agent Mode supports flexible ways to connect to your SQL database, either by referencing saved profiles or by specifying a server and database directly. Here's how the connection logic works:
87
+
GitHub Copilot Agent Mode supports flexible ways to connect to your SQL database, either by referencing saved profiles or by specifying a server and database directly. Here's how the connection logic works.
84
88
85
-
When you connect via saved profile:
89
+
When you connect with a saved profile:
86
90
87
-
1.A user can connect by referencing the name of a saved connection profile.
91
+
1.You connect by referencing the name of a saved connection profile.
88
92
1. GitHub Copilot uses the `mssql_list_servers` tool to verify the profile exists.
89
93
1. The `mssql_connect` tool then uses the saved `profileId` and its parameters to establish the connection.
90
94
91
-
When you connect via server/database specification:
95
+
When you connect by specifying a server and database:
92
96
93
97
- If a saved profile matches both the specified server and database:
94
98
@@ -105,7 +109,7 @@ When you connect via server/database specification:
105
109
106
110
- GitHub Copilot reports an error.
107
111
108
-
This flexible matching system allows GitHub Copilot to handle a range of connection scenarios, minimizing user effort while ensuring secure, confirmable actions.
112
+
This flexible matching system allows GitHub Copilot to handle a range of connection scenarios. It minimizes user effort while ensuring secure, confirmable actions.
109
113
110
114
### Schema exploration
111
115
@@ -119,7 +123,7 @@ This flexible matching system allows GitHub Copilot to handle a range of connect
119
123
120
124
#### Examples
121
125
122
-
The following phrases can be used to interact with GitHub Copilot.
126
+
Use the following phrases to interact with GitHub Copilot.
123
127
124
128
```copilot-prompt
125
129
- Show me the schema for this database
@@ -135,11 +139,11 @@ The following phrases can be used to interact with GitHub Copilot.
135
139
136
140
| Tool name | Description |
137
141
| --- | --- |
138
-
|`run_query`|Executes a SQL query against the connected database. |
142
+
|`run_query`|Runs a SQL query against the connected database. |
139
143
140
144
#### Examples
141
145
142
-
The following phrases can be used to interact with GitHub Copilot.
146
+
Use the following phrases to interact with GitHub Copilot.
143
147
144
148
```copilot-prompt
145
149
- Give me the top five posts published this week
@@ -153,15 +157,15 @@ The following phrases can be used to interact with GitHub Copilot.
153
157
154
158
## How tools are managed in Agent Mode
155
159
156
-
GitHub Copilot can invoke MSSQL-specific tools and other extension-contributed tools while processing your request. These tools are visible in the Agent Mode interface under the Tools menu, where you can enable or disable specific tools.
160
+
GitHub Copilot can use MSSQL-specific tools and other extension-contributed tools while it processes your request. You can see these tools in the Agent Mode interface under the **Tools** menu, where you can also turn specific tools on or off.
157
161
158
-
When a tool is invoked—especially if it interacts with your machine or database—GitHub Copilot prompts for confirmation to ensure secure execution. You can allow the tool for just the current session, the workspace, or approve it permanently.
162
+
When you invoke a tool, especially if it interacts with your machine or database, GitHub Copilot asks for confirmation to ensure secure execution. You can allow the tool for just the current session, the workspace, or permanently.
159
163
160
-
For more on tool visibility and approvals, visit[Manage tool approvals](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
164
+
For more information about tool visibility and approvals, see[Manage tool approvals](https://code.visualstudio.com/docs/copilot/chat/copilot-chat#_builtin-chat-modes).
161
165
162
166
### Agent Mode confirmation workflow
163
167
164
-
When GitHub Copilot selects a tool, it prompts you with a confirmation dialog showing details about the requested action. You must explicitly approve the request before it can execute any commands that interact with your machine or database:
168
+
When GitHub Copilot selects a tool, it prompts you with a confirmation dialog that shows details about the requested action. You must explicitly approve the request before it can execute any commands that interact with your machine or database:
Copy file name to clipboardExpand all lines: docs/tools/visual-studio-code-extensions/github-copilot/business-logic-explainer.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how GitHub Copilot helps developers understand and work with
5
5
author: croblesm
6
6
ms.author: roblescarlos
7
7
ms.reviewer: randolphwest
8
-
ms.date: 11/18/2025
8
+
ms.date: 01/19/2026
9
9
ms.service: sql
10
10
ms.subservice: vs-code-sql-extensions
11
11
ms.topic: quickstart
@@ -19,7 +19,7 @@ ai-usage: ai-assisted
19
19
20
20
# Quickstart: Use the business logic explainer
21
21
22
-
In this quickstart, you learn how the business logic explainer helps developers understand and work with complex application logic implemented in SQL, ORM (Object-Relational Mapping) frameworks, or directly in the database. The assistant analyzes SQL code, ORM models, or existing database schemas to explain the underlying business rules and provide actionable documentation.
22
+
In this quickstart, you learn how the business logic explainer helps developers understand and work with complex application logic implemented in SQL, object-relational mapping (ORM) frameworks, or directly in the database. The assistant analyzes SQL code, ORM models, or existing database schemas to explain the underlying business rules and provide actionable documentation.
Copy file name to clipboardExpand all lines: docs/tools/visual-studio-code-extensions/github-copilot/code-generation.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how GitHub Copilot can accelerate database-related code gener
5
5
author: croblesm
6
6
ms.author: roblescarlos
7
7
ms.reviewer: randolphwest
8
-
ms.date: 11/18/2025
8
+
ms.date: 01/19/2026
9
9
ms.service: sql
10
10
ms.subservice: vs-code-sql-extensions
11
11
ms.topic: quickstart
@@ -19,7 +19,7 @@ ai-usage: ai-assisted
19
19
20
20
# Quickstart: Generate code
21
21
22
-
In this quickstart, you learn how GitHub Copilot accelerates SQL and object-relational mapping (ORM) development by generating context-aware code directly within Visual Studio Code. GitHub Copilot helps you scaffold tables, evolve schemas, and reduce repetitive scripting. Whether you're using T-SQL, or working with ORMs like Entity Framework, Sequelize, Prisma, or SQLAlchemy, GitHub Copilot helps you focus on building application logic.
22
+
In this quickstart, you learn how GitHub Copilot accelerates SQL and object-relational mapping (ORM) development by generating context-aware code directly within Visual Studio Code. GitHub Copilot helps you scaffold tables, evolve schemas, and reduce repetitive scripting. Whether you're using Transact-SQL, or working with object-relational mapping (ORM) frameworks like Entity Framework, Sequelize, Prisma, or SQLAlchemy, GitHub Copilot helps you focus on building application logic.
23
23
24
24
## Get started
25
25
@@ -29,11 +29,11 @@ In this quickstart, you learn how GitHub Copilot accelerates SQL and object-rela
29
29
30
30
Use GitHub Copilot to generate SQL and ORM-compatible code that reflects your connected database's structure and follows best practices. From defining tables and relationships to scripting views, building migration files, or scaffolding data access layers and APIs, GitHub Copilot helps you move faster and with greater confidence.
31
31
32
-
Here are common use cases and examples of what you can ask via the chat participant:
32
+
Here are common use cases and examples of what you can ask through the chat participant:
33
33
34
34
### Generate SQL code
35
35
36
-
GitHub Copilot can help you generate SQL code for several development scenarios, from scripting, creating and modifying tables to writing stored procedures and views. These examples illustrate how you can use GitHub Copilot to automate repetitive SQL scripting and follow best practices for T-SQL development.
36
+
GitHub Copilot can help you generate SQL code for several development scenarios, from scripting, creating, and modifying tables to writing stored procedures and views. These examples illustrate how you can use GitHub Copilot to automate repetitive SQL scripting and follow best practices for T-SQL development.
37
37
38
38
#### Script out all tables in a schema
39
39
@@ -126,11 +126,11 @@ Generate a full-stack app using Azure SQL bindings for Functions and Blazor WebA
126
126
127
127
- Configure SQL Bindings to automatically read and write data from the `SalesLT.Customer` table.
128
128
- Implement HTTP-triggered functions with the following endpoints:
129
-
- `GET /api/customers` – Fetch all customers.
130
-
- `GET /api/customers/{id}` – Get a specific customer by ID.
131
-
- `POST /api/customers` – Create a new customer.
132
-
- `PUT /api/customers/{id}` – Update an existing customer.
133
-
- `DELETE /api/customers/{id}` – Delete a customer.
129
+
- `GET /api/customers` - Fetch all customers.
130
+
- `GET /api/customers/{id}` - Get a specific customer by ID.
131
+
- `POST /api/customers` - Create a new customer.
132
+
- `PUT /api/customers/{id}` - Update an existing customer.
133
+
- `DELETE /api/customers/{id}` - Delete a customer.
134
134
- Use `Dependency Injection` for database connections and logging.
135
135
- Include an `appsettings.json` file to store database connection strings and environment variables.
136
136
- Use `Azure Functions Core Tools` to run and test the functions locally.
@@ -157,11 +157,11 @@ Generate a REST API using Node.js with Express that connects to my local SQL Dat
157
157
158
158
- Establish a database connection using Prisma with Tedious as the SQL Server driver.
159
159
- Implement API routes for `SalesLT.Customer` with the following endpoints:
160
-
- `GET /customers` – Fetch all customers.
161
-
- `GET /customers/:id` – Get a specific customer by ID.
162
-
- `POST /customers` – Create a new customer.
163
-
- `PUT /customers/:id` – Update an existing customer.
164
-
- `DELETE /customers/:id` – Delete a customer.
160
+
- `GET /customers` - Fetch all customers.
161
+
- `GET /customers/:id` - Get a specific customer by ID.
162
+
- `POST /customers` - Create a new customer.
163
+
- `PUT /customers/:id` - Update an existing customer.
164
+
- `DELETE /customers/:id` - Delete a customer.
165
165
- Configure `Prisma` to map the `SalesLT.Customer` table and generate database migrations using `prisma migrate dev`.
166
166
- Use `dotenv` for environment variables (database credentials, ports, etc.).
167
167
- Add `Jest` for testing the API endpoints.
@@ -185,11 +185,11 @@ The following example is a detailed prompt you can provide in GitHub Copilot Cha
185
185
Scaffold a Django backend with Django REST Framework for the `SalesLT.Customer` table. Follow these steps:
186
186
187
187
- Implement API routes using Django's `ModelViewSet` with the following endpoints:
188
-
- `GET /customers` – Fetch all customers.
189
-
- `GET /customers/{id}` – Get a specific customer by ID.
190
-
- `POST /customers` – Create a new customer.
191
-
- `PUT /customers/{id}` – Update an existing customer.
192
-
- `DELETE /customers/{id}` – Delete a customer.
188
+
- `GET /customers` - Fetch all customers.
189
+
- `GET /customers/{id}` - Get a specific customer by ID.
190
+
- `POST /customers` - Create a new customer.
191
+
- `PUT /customers/{id}` - Update an existing customer.
192
+
- `DELETE /customers/{id}` - Delete a customer.
193
193
194
194
- Add instructions for generating database migrations with `python manage.py makemigrations` and `migrate`.
Copy file name to clipboardExpand all lines: docs/tools/visual-studio-code-extensions/github-copilot/inline-copilot-suggestions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to use GitHub Copilot's inline suggestions and chat exper
5
5
author: croblesm
6
6
ms.author: roblescarlos
7
7
ms.reviewer: randolphwest
8
-
ms.date: 11/18/2025
8
+
ms.date: 01/19/2026
9
9
ms.service: sql
10
10
ms.subservice: vs-code-sql-extensions
11
11
ms.topic: quickstart
@@ -115,7 +115,7 @@ Generate a Sequelize migration to add a foreign key from `SalesLT.SalesOrderDeta
115
115
116
116
## Use inline suggestions with GitHub Copilot
117
117
118
-
You can start by typing a T-SQL query in a new editor window, like `SELECT * FROM SalesLT.Customer`, and observe the inline suggestions provided by GitHub Copilot. The suggestions will appear as you type, and you can accept them by pressing `Tab` or `Enter`.
118
+
You can start by typing a T-SQL query in a new editor window, like `SELECT * FROM SalesLT.Customer`, and observe the inline suggestions provided by GitHub Copilot. The suggestions appear as you type, and you can accept them by pressing `Tab` or `Enter`.
119
119
120
120
Alternatively, you can type the same query, `SELECT * FROM SalesLT.Customer`, directly into the editor. Then, highlight it to reveal the ✨ **smart action** icon, which appears next to the highlighted query. This icon provides quick access to additional GitHub Copilot options, such as `Modify using Copilot` to adjust your query, `/doc` to generate documentation, or the ability to ask GitHub Copilot general questions related to the query.
121
121
@@ -125,7 +125,7 @@ When you select **Review using GitHub Copilot**, you see an inline recommendatio
125
125
126
126
:::image type="content" source="media/inline-copilot-suggestions/vscode-inline-recommendation.png" alt-text="Screenshot showing an inline recommendation from GitHub Copilot for optimizing a SQL query in Visual Studio Code." lightbox="media/inline-copilot-suggestions/vscode-inline-recommendation.png":::
127
127
128
-
You can also invoke GitHub Copilot via a shortcut (`⌘+I` for macOS / `Ctrl+I` for Windows/Linux) and ask questions or request modifications to your query.
128
+
You can also invoke GitHub Copilot using a shortcut (**Cmd**+**I** for macOS, or **Ctrl**+**I** for Windows and Linux) and ask questions or request modifications to your query.
129
129
130
130
:::image type="content" source="media/inline-copilot-suggestions/vscode-copilot-shortcut.png" alt-text="Screenshot demonstrating how to invoke GitHub Copilot using the keyboard shortcut in Visual Studio Code." lightbox="media/inline-copilot-suggestions/vscode-copilot-shortcut.png":::
0 commit comments