Excel - Concatenate function to create SQL

Card Puncher Data Processing

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

Sql With Single Quote

  • 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





Discover More
Card Puncher Data Processing
Excel - Text (String) data type

If the find function doesn't find the text it will return a #value. To avoid this the ISERROR function is used. See
Card Puncher Data Processing
Microsoft Excel

Excel is a spreadsheet tool that you can categorize in the desktop database. It's a reactive tool (a cell update is reflected in all dependent cell). Lukas...



Share this page:
Follow us:
Task Runner