TOP

Function TableToSql

TABLETOSQL() Description

The TABLETOSQL() function converts values from a table into a ready-to-use SQL command INSERT INTO. In doing so, it automatically takes the name of the current sheet and uses it as the name of the future SQL table.

The resulting outcome allows for quick and convenient import of tabular data directly into a database.


Key Features of the TABLETOSQL Function

Syntax:

=TABLETOSQL(Range)

Parameters:

Usage Example

The TABLETOSQL() function is easy to use. You just need to select a table with headers and Excel (Calc) will automatically return the text in the format of the SQL command "INSERT INTO":

=TABLETOSQL(Range)

We will get the following result:

Example of using the TABLETOSQL() function
Example of using the TABLETOSQL() function

The following values are used in this example:

Download the extension

You can use the TABLETOSQL() function by installing the YLC Utilities extension.

After this, this function will be available in all files opened in Excel (LibreOffice Calc).


This function is available in the following extensions: YLC LightYLC FunctionsYLC Utilities

The YLC Utilities menu in LO Calc

The YLC Utilities menu in LO Calc

The YLC Utilities menu in Excel

The YLC Utilities menu in Excel