1

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

我正在 Azure 中寻找将在 Azure blob 中创建文件的 sql 语句。

4

1 回答 1

2

您正在寻找 CREATE EXTERNAL TABLE AS SELECT。

从文档:

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>  
于 2019-03-06T20:38:43.573 回答