Lukla Data Studio Docs

Docs Database tools

Test data generator

Fill a table with realistic rows for testing: a generator per column chosen from its type and name, NULL rates, repeatable seeds, a preview, and an INSERT script.

On this page
  1. A generator per column
  2. Repeatable rows
  3. The script

Right-click a table ▸ Generate Test Data… to fill it with rows that look real: names in name columns, emails in email columns, dates in date columns, and existing parent keys in foreign keys, so the rows insert without breaking constraints.

Test Data for Northwind's Employees: each column with its type, generator and NULL rate, and a preview of ten generated rows
A generator per column, then a preview of the rows.

#A generator per column

Each column starts with a generator picked from its type and name; change any of them from its menu.

ColumnStarts as
Identity, computed or rowversionLeave out (server default)
Foreign keyExisting parent key, picked from the parent table's rows
Unique integerSequence (1, 2, 3…); other integers a Random number that fits the type
decimal, money, floatRandom decimal that fits the precision and scale
bitRandom 0/1
date / datetimeDate or Date and time within the last five years
uniqueidentifierGUID
Text named like email, first…, last…/surname, name/contact, phone/mobile/fax, city/town, country, company, url/websiteEmail, First name, Last name, Full name, Phone, City, Country, Company, URL
Other textLorem text, cut to the column's length

Nullable columns get a NULL rate (10% to start), and unique text columns get the row number in front so values never repeat.

#Repeatable rows

Set how many rows (up to 100,000) and a seed. The same seed always gives the same rows, so a bug found with seed 820434 can be reproduced later; New Seed picks another. The preview shows the first rows as they will be inserted.

#The script

Script N Rows opens an INSERT script in a query tab: one transaction, in batches of 1,000 rows (the most one VALUES list can hold). Nothing runs until you run it.

T-SQL
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRANSACTION;
INSERT INTO [dbo].[Employees] ([LastName], [FirstName], [Title], [BirthDate], [City], [ReportsTo]) VALUES
    (N'Sato', N'Diego', NULL, '2022-05-14T17:02:30', N'Lisbon', 2),
    (N'Anderson', N'Jonas', N'Sed magna labore et', '2022-03-07T00:02:46', N'Osaka', 5),
    …;
COMMIT TRANSACTION;

(Abridged: the real script lists every column you didn't leave out.)