microsoft / microsoft/vscode-mssql

[Feature Request]: Ability to Mark Existing Scripts as Pre/Post-Deployment in SQL Projects

Open
#20,715 0 comments 0 reactions 0 assignees View on GitHub
Area - SQL Project Enhancement User-filed
Dominant language
TypeScript
Stars
1.9k
Forks
610
Avg merge
2d 3h
Merged PRs (30d)
97

Description

### Feature Description

# Summary
Currently, SQL Database Projects only allow adding new pre- or post-deployment scripts. There is no built-in way to mark an existing .sql file as a **PreDeploy** or **PostDeploy** item. The only workaround is manually editing the .sqlproj XML, which is error-prone and inconsistent with other project item workflows.

# Problem
Developers commonly refactor scripts or want to convert an existing .sql file into a pre/post deployment script. Since the UI/commands always create a new file, users must hand-edit:
```xml

```

This manual process often leads to build errors (SQL46010, SQL70001) and adds unnecessary friction, especially in VS Code and SDK-style SQL projects.

# Requested Enhancement
Add a way to mark an existing SQL file as a Pre-Deployment or Post-Deployment script, via:

Right-click context menu

Command Palette action (SQL: Set as Pre-Deployment Script)

CLI option

Any equivalent UI flow

The action should automatically update the .sqlproj file correctly, without requiring users to create new scripts or manually edit XML.

# Impact
This would reduce errors, simplify workflows, and improve usability for both new and experienced SQL project users

### Problem and Motivation

See Above

### Related Area

- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] 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
- [x] 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 by locating the SQL Database Projects command and project-item handling in the TypeScript extension, then review how .sqlproj entries are represented. Done means an existing .sql file can be selected through an implemented workflow and the .sqlproj XML is updated as a valid PreDeploy or PostDeploy item without manual editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
databases, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.