Azure SQL数据库/数据仓库中是否有任何命令类似于Redshift中的UNLOAD语句?
我正在Azure中寻找一条sql语句,该语句将在Azure blob中创建一个文件。
答案 0 :(得分: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>