For your first question, the option HEADER_ROW
is not available in the syntax of creating an external file format in Azure Synapse serverless SQL pools.
Regarding your second question, the column names in the external table definition do not need to be in the same order as the columns in the file. You can specify the column order in the CREATE EXTERNAL TABLE
statement using the COLUMN_ORDINAL
option.
Here's an example of how to create an external table with custom column order:
CREATE EXTERNAL TABLE MyExternalTable (
Column3 int,
Column1 varchar(100),
Column2 varchar(50)
)
WITH (
LOCATION = 'my/location',
DATA_SOURCE = MyDataSource,
FILE_FORMAT = MyFileFormat,
REJECT_TYPE = VALUE,
REJECT_VALUE = 0,
COLUMN_ORDINAL = 'Column3, Column1, Column2'
);
In the example above, the columns in the external table are defined in a different order than the columns in the file. The COLUMN_ORDINAL
option is used to specify the order of the columns in the file.
References: