Equivalent to Oracle external tables in SQL Server

后端 未结 3 1085
伪装坚强ぢ
伪装坚强ぢ 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 20:41

    Upgrade to sql server 2016 to get what you need.

    0 讨论(0)
  • 2020-12-11 20:44

    You need to create external links. Creating a linked server using the Text IISAM is one. You may also check this link:(http://msdn.microsoft.com/en-us/library/ms709353.aspx)

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题