microsoft / microsoft/vscode-mssql
[Feature Request]: Open Edit Data from SQL script results
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Feature Description
Functional Requirements #1:
- I can click on the Edit Data button to open the Edit Data pane in the Query Results pane. The data grid in the Edit Data tab reflects exactly the rows and columns returned by my original SELECT query, even if it includes complex clauses such as WHERE, ORDER BY, JOIN, and more. This behavior is similar to how users edit the Show SQL pane in Edit Data in ADS.
- If the query is invalid, return an error message after user clicks Edit Data.
- If the query doesn't execute and return a query result grid successfully, do not show the Edit Data option.
Figma Design Mock
Functional Requirements #2:
- In Edit Data, I can still view the query that is used to populate the table grid.
- **Script Changes** --> opens the original SQL Script pane that has the UPDATE, INSERT, DELETE scripts. Note that we are changing the bottom pane title from “Definition” to “Script Changes”.
- **Table query** --> view the original SELECT statement that was used to populate the Edit Data grid. Note that this is **read-only.** If user like to edit the query, they need to restart from the query window to ensure proper error validation. For example, if I selected Edit Data > Top 100 Rows, the script here will be:
```
SELECT TOP 100
[CustomerID]
,[AddressID]
,[AddressType]
,[rowguid]
,[ModifiedDate]
FROM [SalesLT].[CustomerAddress]
```
If I run a complex query, the script here could potentially be:
```
SELECT
[C].[FirstName],
[C].[LastName]
FROM [SalesLT].[Customer] AS C
JOIN [SalesLT].[CustomerAddress] AS CA
ON C.CustomerID = CA.CustomerID
JOIN [SalesLT].[Address] AS A
ON CA.AddressID = A.AddressID
WHERE A.CountryRegion = 'Canada'
```
### Problem and Motivation
Based on user feedback, customers want the ability to edit queries to quickly locate specific entries, just like the "Show SQL pane" capability in Azure Data Studio.
In the January release, we are introducing advanced filtering and sorting to reduce the barrier for users who may be less comfortable writing SQL.
Moving to GA, we want to preserve flexibility for more advanced users by enabling direct SQL editing to customize the data grid. Routing users from the SQL query window into Edit Data, rather than allowing direct SQL edits within the Edit Data experience itself, enables stronger error validation and helps prevent invalid queries.
### Related Area
- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query editor
- [ ] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [x] Preview/Edit data
- [ ] Table Designer
- [ ] Schema Designer
- [ ] Schema Compare
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] DACPAC/BACPAC export/import
- [ ] SQL Database projects
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the area
_No response_
### Confirmation
- [x] I have searched existing feature requests and couldn't find a match
- [ ] I want to help implement this feature
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the Preview/Edit data area and Query Results pane described in this issue, tracing how SQL results become the Edit Data grid. Verify the design requirements for preserving the original SELECT as a read-only Table query, showing Script Changes separately, handling invalid queries, and hiding Edit Data when no result grid exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- databases, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100