更新时间: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