microsoft / microsoft/DacFx

SqlPackage/SSDT table rebuild losing Change Tracking CHANGETABLE data

Open
#31 6 comments 0 reactions 1 assignee View on GitHub

@ssreerama is already working on this.

Since Oct 18, 2021.

area: ssdt enhancement sql-feature
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

There are various scenarios where sqlpackage generates a table rebuild script e.g. adding a column in the middle of a table.

However, when this is done, all Change Tracking data for the table held in the CHANGETABLE is lost. This is dangerous in production environments where certain data that should be synchronised is also lost due to it never being recognised as changed.

It seems that SSDT/SqlPackage and Change Tracking are completely incompatible.

Steps to Reproduce:

  1. Enable Change Tracking on database + table
  2. Insert record into table
  3. In SSDT add column in middle of the table
  4. Publish database via SSDT/SqlPackage

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

As far as I'm aware this has never worked.

(DacFx/SqlPackage)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.