microsoft / microsoft/DacFx

[Feature Request]: Add support for the "CREATE OR ALTER ..." statement for SQL stored procedures

Open
#753 4 comments 6 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

Describe Issue:
Please add support for the "CREATE OR ALTER ..." statement for SQL stored procedures as it has been supported since MS SQL 2016.


Steps to Reproduce:



  1. Create an MS SQL stored procedure with the "CREATE OR ALTER" statement.

  2. In Database Projects, select "Create Project from Database."

  3. The "CREATE OR ALTER ..." statement is replaced by "CREATE ..."


Expected Behavior:
Preserve the "CREATE OR ALTER ..." statement or add a parameter to specify the expected behavior.


Actual Behavior:



  • The "CREATE OR ALTER ..." statement is replaced by "CREATE ...".

  • Saving modifications leads to an error in the SQL script because the stored procedure already exists.

Software | Version
-- | --
ms-mssql.sql-database-projects-vscode | 1.5.3
MSSQL Extension | 1.33.0
VS Code | 1.102.0
OS | Windows_NT 10.0.26100

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in Database Projects with the listed SQL Server, MSSQL extension, and VS Code versions, using “Create Project from Database” on a stored procedure containing CREATE OR ALTER. Trace where that statement is converted to CREATE; done means the statement is preserved or the requested behavior can be selected, and saving no longer fails because the procedure already exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.