Medium severitydata format
Power BI Refresh Error:
22001
What does this error mean?
A string value is too long for the target column and was truncated (or the insert was rejected).
Common causes
- 1Source data contains values longer than the column definition allows (e.g., VARCHAR(50) receiving 200-char strings)
- 2Schema was changed to reduce column length after data was already loaded
- 3ETL pipeline does not validate or truncate strings before insert
How to fix it
- 1Step 1: Identify the column with `\d+ <table_name>` and note the character limit.
- 2Step 2: Add a transformation step in the pipeline to truncate or validate string length.
- 3Step 3: Alternatively, alter the column to a larger size: `ALTER TABLE t ALTER COLUMN c TYPE VARCHAR(500);`.
- 4Step 4: Audit source data for abnormally long values that indicate upstream data quality issues.
Frequently asked questions
Official documentation: https://www.postgresql.org/docs/current/errcodes-appendix.html