Setting Up Data Generator

This topic describes how to set up Data Generator to generate test data.

Tip

Before generating data, back up the database you want to populate.

If you’re not satisfied with the results, you can adjust the settings and regenerate the data.

To set up Data Generator:

1. Open the Data Generator Project Properties dialog by doing one of the following:

  • On the top menu, select Database > Tasks > New Data Generation.
  • In Database Explorer, right-click the server connection or database and select Tasks > New Data Generation.

2. On the Connection tab, choose the connection and database for data generation, then click Next.

Connection tab of the Data Generator Project Properties dialog

3. On the Options tab, set up data generation options.

Options tab of the Data Generator Project Properties dialog

The table describes the data generation options.

Name Group Description Default value
By specified number of Row distribution mode Set the number of rows to populate. 1000 rows
By proportion of existing data in volume of Row distribution mode Specify the percentage of rows to populate. 10%
By generation of data by time Row distribution mode Specify the time period in seconds during which data will be generated for each table. 10 sec
Truncate data from table before generation Row distribution mode Controls whether existing data in the target table is removed before new test data is generated.
  • When the checkbox is selected, the table is truncated, and all existing rows are permanently deleted before the data generation process begins.
  • When the checkbox is cleared, generated data is appended to the existing data in the table.
 
Random by timestamp Value distribution mode Select the option if you want to populate every subsequent data generation with new random numbers.  
Random by seed Value distribution mode Select the option and specify the seed value based on which the values will be generated. When you repopulate the column, you will get the same data collection. 1
Sequential Value distribution mode Select the option to generate the values sequentially.  
Set values to be unique Column properties Select the checkbox to make the generated values unique.  
Include NULL values % of rows Column properties Select the checkbox and specify the percentage of NULL values to be generated. 10%
Include empty values % of rows Column properties Select the checkbox and specify the percentage of empty values to be generated. 10%
Country-specific data Column properties Choose a country to which conventions the generated data will follow. United States

4. Click Open to open a data generation project with the .dgen extension.

5. In the Tables and columns to populate pane, select the tables and columns for which you want to generate data.

6. Select the table and set up table generation settings. Repeat this step for each table you want to populate with data.

7. Select the column and set up column generation settings. Repeat this step for each selected column.

Note

All changes are displayed in the preview pane in real time.

Data generation document with a tree pane, generation settings pane, and data preview

Warning

Data generation may fail if a column includes a foreign key that references a table not included in the generation process.

To resolve the issue:

1. Select the table causing the error.

2. In the Table generation settings pane, navigate to the Related tables section.

3. Include or exclude the related parent and child tables as needed.

8. Click Green arrow icon Populate data to the target database to open the Data Population Wizard.

9. On the Output tab, select the output option to manage a data population script, then click Next:

  • Open the data population script in the internal editor to add custom data to the database.
  • Save the SQL script to a file.
  • Execute the data population script against the database immediately.

Output page of the Data Population Wizard

10. On the Options tab, select general data population options and click Next.

Options  tab of the Data Population Wizard

Tip

You can click the name of an option to view its detailed description.

In the search box, you can start typing the option name. The options matching your search will be highlighted.

To save the options you’ve set for later use, click Save As My Defaults.

To use the default settings of the tool, click Devart Defaults.

To use the options you saved earlier, click My Defaults.

11. On the Additional Scripts tab, enter or choose the script you want to execute before or after data population, then click Next.

You might use this option in scenarios, such as dropping existing data or temporarily disabling triggers before data generation, then re-enabling them afterward.

12. On the Summary tab, review the data generation action plan and check for any errors or warnings that highlight potential problems.

13. Click Generate to complete the data generation process.