Create SQL Script By Template

The Script Mapper tool allows you to create an SQL text based upon provided tabular data and a textual template. Number of lines in result text will be equal to number of rows in the data table. Use column name in format {$COLUMN_NAME} as a placeholder for actual value of the column from the data table.

At first, you should copy the source data from a spreadsheet. It can be MS Excel file, Google Sheet document, SQL Commander dataset, or any similar. First row of the data must contain column names:

copy spreadsheet
script data source

Click SQL Commander main menu button, then use Script Mapper item. In the window appears, click “Paste Data from Clipboard” button. If data format is correct, you’ll see it in the table:

sql by template

Here you can additionally edit data as you need. Once complete, provide the script template as on the picture above. Then, click Generate button. In the main window of SQL Commander, new SQL tab containing your script will be created:

result sql script

At any time, you can go back to Script Mapper window and fix grid or template data, and then re-generate the SQL script.

Tips

  • As a data source, you can also use simple text from a Notepad, separated by TAB symbol (Alt + 09).
  • Use table columns context menu (right-click) to copy column name.
  • For deep source data analysis, use local SQL query: table cell context menu -> Query This Dataset command.
Scroll to Top