且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

等效于SQL Server中的Oracle外部表

更新时间:2023-02-05 11:00:02

Harold Javier的答案是一个很好的答案,
但您可能还想考虑将 OPENROWSET BULK一起使用关键词.

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.

它应该看起来像这样:

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

您应该添加一个fmt文件,而不是在表定义中给出格式(如在oracle中). 此处是如何创建

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