dbt-sqlserver
dbt-sqlserver copied to clipboard
Bug in incremental model: ('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'column'. (156) (SQLExecDirectW)")
The following query failed when the source table has a column removed
{{ config(
materialized = 'incremental',
unique_key = 'date',
on_schema_change = "sync_all_columns",
) }}
SELECT
DISTINCT *
FROM
<source table>
The full error message is
('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'column'. (156) (SQLExecDirectW)")
Same error for on_schema_change = "append_new_columns",
and if I use
{{ config(
materialized = 'incremental',
unique_key = 'date',
on_schema_change = "ignore",
) }}
I'll get this error message:
('42S22', "[42S22] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name '<the removed column>'. (207) (SQLExecDirectW)")