microsoft / microsoft/DacFx

Deploying Table with masked function generate alter statements when removing the spaces

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

Description

- SqlPackage or DacFx Version: Both
- .NET Framework (Windows-only) or .NET Core: Both
- Environment (local platform and source/target platforms): Any

**Steps to Reproduce:**

The DDL shows the following:
CREATE TABLE [PARTY]
{
[ACCESS_NUMBER] varchar(14) MASKED WITH (FUNCTION = 'partial(2,"xxxx",0) NOT NULL,

DB shows the following:
CREATE TABLE [PARTY]
{
[ACCESS_NUMBER] varchar(14) MASKED WITH (FUNCTION = 'partial(2, "xxxx", 0) NOT NULL,

Even though the statements mean the same, it will cause ALTER COLUMN or RECREATE TABLE.
This issue is that every time the script is run, it tries to modify the DB, but the DB remains the same with spaces.

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

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with SqlPackage or DacFx using the masked column definition shown in the report, comparing the generated DDL with the database definition. Trace the schema comparison that treats spacing inside the masking function as a change; done means repeated deployments no longer generate ALTER COLUMN or RECREATE TABLE statements for equivalent definitions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.