Import multiple files

SQL DataTool allows you to import multiple textfiles and comma separated files at once. This way, you can add multiple tables to the SQL database in one run. Or you can append data to multiple already existing tables.

To import multiple files in one importbatch, select the system and version in the Import data screen. This way, you link a datamodel to the import. As Source type, select 'Folder'. Next you have to select the folder that contains the files that need to be imported.

SQL import multiple files

In the Text file settings section, you can enter the details based on the contents of the files. You do not need to select a table name. If you hit the Get data button, the files will be imported.

To append data, check the Append data checkbox. Instead of creating new tables, data is added to the already existing tables. If a table does not yet exist, the table is created.

Prerequisites

The files that you want to import, need to be named according to the tables in the datamodel. As an example: if you want to import the tables 'customer', 'vendor', 'orders', and 'invoices', you should have defined these tables with the same names in the datamodel in SQL DataTool. The files that you want to import, should be named according to this (e.g. 'customer.txt', 'vendor.txt', 'orders.csv', and 'invoices.txt').

Error handling

The error handling is the same as importing a single textfile. This means that rows that cannot be imported, will be added to a newly created file with a postfix '_error' (e.g. 'customers_error.txt').

Besides that, files that cannot be imported because no table has been defined in the datamodel are also logged.

In the folder that is imported, a 'import_log.txt' file is generated. This contains an overview of the status (e.g. success or error) per file. This data is also stored in SQL DataTool separately, so you can review these in the tool itself.