microsoft / microsoft/vscode-mssql

[GitHub Copilot - Feature request]: Add Database Object Context References in Chat

Open
#21,110 0 comments 0 reactions 1 assignee View on GitHub

@caohai is already working on this.

Since Feb 6, 2026.

Area - GitHub Copilot Enhancement
Dominant language
TypeScript
Stars
1.9k
Forks
610
Avg merge
2d 3h
Merged PRs (30d)
97

Description

### Description

Add the ability to reference database objects as context in GitHub Copilot Chat (Ask/Agent) using a `#mssql-object` command, similar to how files can be referenced using `#file.md` today.

**Proposed Behavior:**
- Users should be able to type `#mssql-object` followed by a database object path (e.g., `#mssql-object Sales.dbo.Or...`)
- As the user types, an auto-complete floating window should appear showing matching database objects from the current active connection
- The auto-complete should support intelligent filtering based on database name, schema, and object name patterns
- Selected objects would be added as context to the chat session, allowing Copilot to provide more specific and relevant suggestions

**Example Usage:**
- Type: `#mssql-object Sales.dbo.Or...`
- See: Auto-complete list showing all objects in the Sales database, dbo schema, with names starting with "Or" (e.g., Orders, Orders_by_Category, etc.)
- Select: The desired object to add it as context to the chat

Image

### Problem and Motivation

Currently, when working with databases in VS Code with the MSSQL extension, there's no easy way to add specific database objects (tables, views, stored procedures, functions, etc.) as context to GitHub Copilot Chat. This limitation makes it harder to get precise, context-aware assistance when working with database schemas.

This feature would:
- Enable more accurate and relevant Copilot responses by providing specific database schema context
- Improve developer productivity when working with SQL databases
- Allow users to quickly reference specific tables, views, stored procedures, or functions without manually describing their structure
- Leverage the existing active connection from the chat session to provide seamless database object discovery

### Affected Area

- [x] Agent mode
- [x] Ask mode
- [ ] Slash commands
- [ ] Code generation
- [x] Connection management
- [x] Schema exploration and object management
- [ ] Query execution and performance advisor
- [ ] Other (please describe below)

### If you selected "Other", please describe the affected area

_No response_

### Environment Information (Optional)

- VS Code: Latest
- MSSQL extension: Latest

### Confirmation

- [x] I have searched existing issues and couldn’t find a match
- [ ] I want to work on this issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.