New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing dacpac will fail if table has CHANGE_TRACKING ON #25592
Comments
Trying to ask if is this addressed ?. I ran into same issue |
@GardarG : Things worked for me by setting below options in publish file & I no longer see ALTER DB SET CHANGE_TRACKING = OFF WITH ROLLBACK IMMEDIATE;
However I still see a comment in deployment script with PRINT N'Altering table [user_schemaname].[user_tablename]...;' for the table with CDC enabled in my database. But no actual code beneath the comment. Not sure if this is bug or anything to do with my setting. Please let me know if you see the same on your end. |
Type: Bug
Steps to Reproduce:
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
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
The text was updated successfully, but these errors were encountered: