microsoft / microsoft/DacFx

Schema bound view is not blocking table rebuilds

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

Description

- SqlPackage or DacFx Version: 162.5.57.1
- .NET Framework (Windows-only) or .NET Core: 8.0.11
- Environment (local platform and source/target platforms): sqlpackage cli to azure sql database

**Steps to Reproduce:**

1. Create a sqlproj project
2. Add a table and a view WITH SCHEMABINDING to the table
3. Publish sqlproj to a sql server database
4. Alter the table in a way requiring the table to be rebuilt (e.g. new column in the middle of table)
5. Publish sqlproj to the sql server database
6. Publish succeeds by dropping the views schema binding, rebuilding table, then adding schema binding back to the view

I expected that the table would not get rebuilt. If the schema binding simply gets dropped, there is no value in schema binding.

**Did this occur in prior versions? If not - which version(s) did it work in?**
yes

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start by reproducing the schema-bound view and table rebuild with a sqlproj and SqlPackage against Azure SQL, then inspect the publish behavior around dropping and restoring the binding. Done means the deployment no longer silently permits the table rebuild by removing the view's schema binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, sql
Domain
cli, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.