Excel - Concatenate function to create SQL

About

How to create a function in order to create a SQL statement in Excel with the CONCATENATE function.

Steps

  • Add a simple quote before all single quote in the data columns

  • Then write a formula column as below

In English

=CONCATENATE("INSERT INTO TABLE (COLUMN1, COLUMN2) VALUES ('"; $A2; "', '";$B2; "');" )

In Dutch

=TEKST.SAMENVOEGEN(("INSERT INTO TABLE (COLUMN1, COLUMN2) VALUES ('"; $A2; "', '";$B2; "');" )

The separator character can change in function of the Excel locale


Powered by ComboStrap