Medium severitydata integrity
Power BI Refresh Error:
515
What does this error mean?
An INSERT or UPDATE attempted to place a NULL value into a column defined as NOT NULL.
Common causes
- 1Source data has NULL in a column that the target schema requires as NOT NULL
- 2ADF column mapping is missing — a required column is unmapped and defaults to NULL
- 3A new NOT NULL column was added to the target table without a default value and old pipelines don't provide it
How to fix it
- 1Step 1: Identify the column from the error message. Verify it is NOT NULL: SELECT COLUMN_NAME, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MyTable' AND COLUMN_NAME = 'col';
- 2Step 2: In ADF, add an explicit column mapping and use a Derived Column transformation to replace NULL with a default value: iif(isNull(col), 'default', col).
- 3Step 3: Add a default constraint to the column to handle NULLs from old pipelines: ALTER TABLE [table] ADD CONSTRAINT [DF_col] DEFAULT ('unknown') FOR [col];
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-515-database-engine-error