I’m getting the below error while trying to ADD CONSTRAINT in Azure DataWarehouse

azure-sql-data-warehouse

Msg 104467, Level 16, State 1, Line 1
Enforced unique constraints are not supported in Azure SQL Data Warehouse. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement.

Best Answer

If you look at the list of Unsupported Table Features for Azure SQL Data Warehouse, unique constraints is still on that list as at today:

Unsupported Table Features in SQL DW

It may be that they get supported at some point in the future but I wouldn't hold your breath for this MPP system. As a workaround, get your ELT/ETL process to ensure records are unique during ingest for example, or make an assumption where the data has been imported from an upstream system which does have unqiue constraints, that it is valid. Do some validation via reports / queries to check.