microsoft / microsoft/vscode-mssql
[Feature Request]: "SELECT TOP 1000" action should result in a clean-state editor so it doesn't prompt to save when closing
@aasimkhan30 is already working on this.
Since Jul 13, 2026.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Feature Description
When using the "Select Top 1000" context menu action on a table in Object Explorer, the generated SQL script should open in a clean (non-dirty) editor state. This means closing the tab without having made any edits should not trigger a "Do you want to save?" prompt.
- "Select Top 1000" (and other auto-generated scripts from context menus) should open in a clean editor state.
- Closing the tab without editing should not prompt to save.
- Closing the tab after the user has made edits should still prompt to save (preserving existing safety behaviour).
### Problem and Motivation
Currently, right-clicking a table and selecting "Select Top 1000" opens an untitled editor with the generated SELECT statement. Because the editor is immediately marked as dirty, closing the tab always prompts the user to save — even if they haven't modified the script at all.
This is a common workflow friction point. Users frequently run "Select Top 1000" to quickly inspect data, review the results, and then close the tab. Having to dismiss a save dialog every time adds unnecessary clicks and interrupts the flow.
In SSMS, generated scripts from equivalent actions (e.g. "Select Top 1000 Rows") can be closed without a save prompt when the user hasn't made any changes. So this expected behaviour for behaviour for users coming over from SMSS.
### Related Area
- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [x] Query editor
- [ ] Query results panel
- [ ] Object Explorer
- [ ] GitHub Copilot integration
- [ ] 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.