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.
Import to one table
To import all files from one folder to one table, select the right table in the 'Text file settings' section. All data from the files in the folder will be imported into one table. Per default, SQL DataTool will drop the existing table and create a new table. The other settings 'Text file settings' section should be set according to the files that need to be imported.
If you want to append all the data from the selected folder to an existing table, just check the 'Append data' checkbox.
Import to multiple tables
You can also import files from the folder in separate tables. In the Text file settings section, 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.
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').
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.