File tree Expand file tree Collapse file tree
dbt/include/sqlserver/macros Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 {%- endcall %}
4646{% endmacro %}
4747
48+ {% macro sqlserver__drop_relation_script(relation) -%}
49+ drop {{ relation.type }} if exists {{ relation.schema }}.{{ relation.identifier }}
50+ {% endmacro %}
51+
4852{% macro sqlserver__check_schema_exists(database, schema) -%}
4953 {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) -%}
5054 --USE {{ database_name }}
8488 path={"identifier": relation.identifier ~ ' _temp_view' },
8589 type=' view' )-%}
8690
87- {{ drop_relation (tmp_relation) }}
91+ {{ sqlserver__drop_relation_script (tmp_relation) }}
8892
89- {{ drop_relation (relation) }}
93+ {{ sqlserver__drop_relation_script (relation) }}
9094
9195 {{ create_view_as(tmp_relation, sql) }}
9296
9397 {{ sqlserver__insert_into_from(relation, tmp_relation) }}
9498
95- {{ drop_relation (tmp_relation) }}
99+ {{ sqlserver__drop_relation_script (tmp_relation) }}
96100
97101 {% if not temporary and as_columnstore -%}
98102 {{ sqlserver__create_clustered_columnstore_index(relation) }}
99103 {% endif %}
104+
100105{% endmacro %}_
101106
102107{% macro sqlserver__insert_into_from(to_relation, from_relation) -%}
You can’t perform that action at this time.
0 commit comments