

Create a sequence with following statement: “CREATE SEQUENCE GENERATEDATASEQ1”.Dowload the code in this Git repository and copy it into the SQL console.
Sql test data generator how to#
How to run the data generator procedureįollow below steps to generate data for your table That was a lot faster than the first version of the script, which was not set-based. On my little test system, I achieved an insert rate of 9 million records per minute for a table with just a few fields. Record updates or deletions are randomized based on the first column of the primary key. The procedure uses the HANA metadata tables to retrieve the table definition. For example, for an integer field, a random integer value is inserted, and for a character-based field, a random string of characters is inserted. Inserts and updates are based on the field definition of the provided table and contain randomized data.

The procedure inserts, updates, or deletes data of a single table, using mostly set-based operations for high-performance. Because others might find the script useful too, I extended the script for easy re-use.

Therefore, I wrote a database procedure to fill my table with the data that I needed. I googled something like “data generator for HANA” but didn’t find what I was looking for. Recently I ran a scenario on the SAP HANA database for which I needed a large initial data set for a specific table, and another large delta data set consisting of deletions, updates and inserts on the initial data set.
