Skip to content

Publishing dacpac will fail if table has CHANGE_TRACKING ON #25592

Open
@GardarG

Description

@GardarG

Type: Bug

Steps to Reproduce:

  1. Create a database with CHANGE_TRACKING enabled and a table with CHANGE_TRACKING enabled
  2. Publish the same database without changes and it will fail.

When looking further into the sqlcmd script that is created, we see that the following code is run BEFORE pre-deployment scripts:

IF EXISTS (SELECT 1
FROM [sys].[databases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET CHANGE_TRACKING = OFF
WITH ROLLBACK IMMEDIATE;
END
GO

As such it is impossible to have change-tracking on a table when publishing. There should be settings in the .publish.xml file to comment out / disable these lines of code.

Extension version: 1.4.2
Azure Data Studio version: azuredatastudio 1.48.0 (4970733, 2024-02-27T00:05:08.293Z)
OS version: Windows_NT x64 10.0.19045
Restricted Mode: No
Preview Features: Enabled
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.74GB (2.20GB free)
Process Argv
Screen Reader no
VM 0%

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions