1

I've recently updated the SqlPackage and it now tries to rebuild tables every time I deploy (<Alert Name="DataMotion">):

PRINT N'Starting rebuilding table [dbo].[Users]...';


GO
BEGIN TRANSACTION;

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

SET XACT_ABORT ON;

CREATE TABLE [dbo].[tmp_ms_xx_Users] (
    <columns>
);

IF EXISTS (SELECT TOP 1 1 
           FROM   [dbo].[Users])
    BEGIN
        INSERT INTO [dbo].[tmp_ms_xx_Users] (<columns>)
        SELECT   <columns>
        FROM     [dbo].[Users]
        ORDER BY [Id] ASC;
    END

DROP TABLE [dbo].[Users];

EXECUTE sp_rename N'[dbo].[tmp_ms_xx_Users]', N'Users';

COMMIT TRANSACTION;

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;


GO

I boiled down the problem. The problem is that SqlPackage now has a native support of ADD SENSITIVITY CLASSIFICATION statements.

Because the classifications were not supported, we had them added as a big post-deployment script.

I tried to include the script into the model, but then SqlPackage complains that the table XXX is not found when trying to apply the annotations.

EXEC : error SQL70511: Table 'Users' was not found [xxxproj]

It seems that SqlPackage want the annotations to be present in the table definition scripts. But doing this would require an extensive rewrite which I would like to avoid.

The question is: is there a switch to ignore the classifications to stop the table rebuilds?

hazzik
  • 13,019
  • 9
  • 47
  • 86

0 Answers0