Skip to content

Commit 7b5e28c

Browse files
fix for adding columns to snapshots
1 parent 80300df commit 7b5e28c

File tree

1 file changed

+2
-2
lines changed
  • dbt/include/sqlserver/macros/materializations/snapshots

1 file changed

+2
-2
lines changed

dbt/include/sqlserver/macros/materializations/snapshots/snapshot.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SQL Server doesnt support this, so we use the 'SELECT * INTO XYZ FROM ABC' synta
1010

1111
{% set columns %}
1212
{% for column in columns %}
13-
, CAST(NULL AS {{column.data_type}}) AS {{column_name}}
13+
, CAST(NULL AS {{column.data_type}}) AS {{ column.quoted }}
1414
{% endfor %}
1515
{% endset %}
1616

@@ -19,7 +19,7 @@ SQL Server doesnt support this, so we use the 'SELECT * INTO XYZ FROM ABC' synta
1919
{% endset %}
2020

2121
{% set tempTable %}
22-
SELECT * INTO {{tempTableName}} {{columns}} FROM [{{relation.database}}].[{{ relation.schema }}].[{{ relation.identifier }}] {{ information_schema_hints() }}
22+
SELECT * {{columns}} INTO {{tempTableName}} FROM [{{relation.database}}].[{{ relation.schema }}].[{{ relation.identifier }}] {{ information_schema_hints() }}
2323
{% endset %}
2424

2525
{% call statement('create_temp_table') -%}

0 commit comments

Comments
 (0)