microsoft / DacFx

SQL Server database schema validation, deployment, and upgrade runtime. Enables declarative database development and database portability across SQL Server versions and environments.
https://aka.ms/sqlpackage-ref
MIT License
292 stars 15 forks source link

Permanent Difference in Custom Table Type Computed Column #432

Open asrichesson opened 3 months ago

asrichesson commented 3 months ago

Steps to Reproduce:

  1. Create an empty sqlproj project. Can be old or new sqlproj type
  2. Add a custom table type with a computed column like so:
    CREATE TYPE MyCustomTableType AS TABLE (
    NormalColumn            int,
    ComputedColumn      AS NormalColumn
    );
  3. Build and Publish the dacpac to a database
  4. Publish the database again to the same database
  5. Expected: No SQL commands are issued
  6. Actual: Table type is dropped and recreated
    Dropping User-Defined Table Type [dbo].[MyCustomTableType]...
    Creating User-Defined Table Type [dbo].[MyCustomTableType]...

Example project is attached here: MyTestDatabase.zip

Doing a schema comparison in Azure Data Studio doesn't reveal any difference. However, doing a schema comparison in visual studio between the project and the database reveals that the isPersistedNullable properties on the computed columns are different. image

Did this occur in prior versions? If not - which version(s) did it work in? This issue was happening back in version 16.1.6374.0 (DacFx/SqlPackage/SSMS/Azure Data Studio)