I have a similar use case to import (or insert) a data table from Excel to a SQL database.
I tried different ways to load the data table (via SQL connect and via direct reading from xls) and to connect to the SQL database but failed as well to use a SQL query to pass the complete data table to the target database.
After giving it another thought, my current understanding is that the SQL query is performed inside the SQL connection.
That means, as long as the data table from the source does not exist in the database, the SQL query referring to it won’t work.
The example with MS Access works as the source table is present in the database already.
One solution is to import via a csv file.
Alternatively, it should work (rather slowly), if you insert the data to the target table row-by-row as values.