Bassal
Bassal

Reputation: 157

Equivalent to Oracle external tables in SQL Server

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

Answers (3)

Ragul
Ragul

Reputation: 512

Upgrade to sql server 2016 to get what you need.

Upvotes: 0

A.B.Cade
A.B.Cade

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

Harold Javier
Harold Javier

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

Related Questions