Reputation: 157
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 very convenient since it allows you to read a flat-file as a table with standard SQL.
Upvotes: 5
Views: 10487
Reputation: 16905
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
Upvotes: 5
Reputation: 887
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)
Upvotes: 2