Equivalent to Oracle external tables in SQL Server

后端 未结 3 1107
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 20:36

Is there an equivalent to Oracle\'s External Table in SQL Server ?

An external table is a table which is mapped to a flat-file in the filesystem.

It is v

3条回答
  •  情话喂你
    2020-12-11 21:02

    Harold Javier's answer is a good one,
    but you might also want to consider using OPENROWSET with the BULK keyword.

    It is different from the external table because you don't "create" a table but more of a query.

    It should look something like this:

    SELECT et.*
    FROM OPENROWSET( BULK 'your_data_file', FORMATFILE = 'your_format_file.fmt') AS et
    

    Instead of giving the format in the table definition (as in oracle), you should add a fmt file.
    Here is how to create it

提交回复
热议问题