Medium severitydata integrity
Power BI Refresh Error:
245
What does this error mean?
SQL Server cannot implicitly convert a string value to a numeric type because the string contains non-numeric characters.
Common causes
- 1Source column contains empty strings or special characters (e.g. 'N/A', '-', '') that cannot be cast to INT or DECIMAL
- 2ADF maps a source VARCHAR column to a target INT column without a transformation step
- 3A data quality change in the source introduced text values in a formerly numeric column
How to fix it
- 1Step 1: Find the bad values: SELECT col FROM source WHERE TRY_CAST(col AS INT) IS NULL AND col IS NOT NULL;
- 2Step 2: In ADF Data Flow, use a Derived Column with TRY_CAST to replace unconvertible values with NULL or a default: iif(isNull(toInteger(col)), 0, toInteger(col)).
- 3Step 3: Fix the source data quality: work with the upstream team to prevent non-numeric values in numeric columns, or add a CHECK constraint on the source.
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-245-database-engine-error