相当于AWS Redshift的“ UNLOAD”语句的Azure SQL数据仓库

时间:2019-03-06 20:28:22

标签: azure azure-sql-database amazon-redshift azure-blob-storage azure-sql-data-warehouse

Azure SQL数据库/数据仓库中是否有任何命令类似于Redshift中的UNLOAD语句?

我正在Azure中寻找一条sql语句,该语句将在Azure blob中创建一个文件。

1 个答案:

答案 0 :(得分:2)

您正在寻找CREATE EXTERNAL TABLE AS SELECT。

From the docs:

CREATE EXTERNAL TABLE [ [database_name  . [ schema_name ] . ] | schema_name . ] table_name   
    WITH (   
        LOCATION = 'hdfs_folder',  
        DATA_SOURCE = external_data_source_name,  
        FILE_FORMAT = external_file_format_name  
        [ , <reject_options> [ ,...n ] ]  
    )  
    AS <select_statement>  
[;]  

<reject_options> ::=  
{  
    | REJECT_TYPE = value | percentage  
    | REJECT_VALUE = reject_value  
    | REJECT_SAMPLE_VALUE = reject_sample_value  
}  

<select_statement> ::=  
    [ WITH <common_table_expression> [ ,...n ] ]  
    SELECT <select_criteria>