File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
dbt/include/sqlserver/macros/adapter Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ {% macro sqlserver__get_empty_subquery_sql(select_sql, select_sql_header= none) %}
2
+ {% if select_sql .strip ().lower ().startswith(' with' ) %}
3
+ {{ select_sql }}
4
+ {% else - %}
5
+ select * from (
6
+ {{ select_sql }}
7
+ ) dbt_sbq_tmp
8
+ where 1 = 0
9
+ {%- endif - %}
10
+
11
+ {% endmacro %}
12
+
13
+ {% macro sqlserver__get_columns_in_query(select_sql) %}
14
+ {% set query_label = apply_label() %}
15
+ {% call statement(' get_columns_in_query' , fetch_result= True, auto_begin= False) - %}
16
+ select TOP 0 * from (
17
+ {{ select_sql }}
18
+ ) as __dbt_sbq
19
+ where 0 = 1
20
+ {{ query_label }}
21
+ {% endcall %}
22
+
23
+ {{ return(load_result(' get_columns_in_query' ).table .columns | map(attribute= ' name' ) | list) }}
24
+ {% endmacro %}
25
+
1
26
{% macro sqlserver__alter_column_type(relation, column_name, new_column_type) %}
2
27
3
28
{%- set tmp_column = column_name + " __dbt_alter" - %}
You can’t perform that action at this time.
0 commit comments