1

I created an external table in toad with the following code and it is working.

    /*External table query*/
--AUTHID CURRENT_USER is
CREATE DIRECTORY ext1 AS 'E:\outer source'

create table countries_external3
      (country_id      varchar2(5),
       country_name    varchar2(50),
       region_id       varchar2(5)
      )
    organization external
      (type oracle_loader
       default directory ext1
       access parameters
        (records delimited by newline
         fields terminated by ','
           (country_id      char(5),
            country_name    char(50),
            region_id       char(5)
           )
        )
      location ('externalfile1.csv')
     )
   reject limit unlimited;

   select * from countries_external

/*External end here*/

But now I want to create an external table in SQL server. I have searched online and found out some polybase term which I could not understand. Right now I am using SQL server 2014. Can I create an external table in SQL server 2014?

zain ul abidin
  • 197
  • 2
  • 13
  • polybase is used to connect hdfs you will create external table in sql server to load the file from hdfs – Mani Dec 19 '18 at 07:21
  • I have an excel file and want to load data from there. – zain ul abidin Dec 19 '18 at 07:25
  • you don't need to go for external table you can use sql server import export wizard to do this – Mani Dec 19 '18 at 07:27
  • actually, external table saves from doing these steps of the wizard when excel file be updated I can execute the code and it will load the data in the database without going through any wizard – zain ul abidin Dec 19 '18 at 07:35
  • If you explain what do you mean by saying "external table" you'll get the answer – sepupic Dec 19 '18 at 07:35
  • 1
    Do you want to load your data from file to server once (bulk load)? Or you want to comunicate with this file many times(linked server)? – sepupic Dec 19 '18 at 07:37
  • many times (linked server) – zain ul abidin Dec 19 '18 at 07:38
  • https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-engine?view=sql-server-2017 – sepupic Dec 19 '18 at 07:44
  • polybase is is used to query relational and non-relational databases (NoSQL). You can use PolyBase to query tables and files in Hadoop or in Azure Blob Storage. You can also import or export data to/from Hadoop. so you need to store your file either in hadoop or azure blob to use external table..If you want to read it from directory you can use SSIS and create a package and schedule that as job to listen is there any change in the excel to update the table. – Mani Dec 19 '18 at 07:49

0 Answers0