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
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.

#A generator per column
Each column starts with a generator picked from its type and name; change any of them from its menu.
| Column | Starts as |
|---|---|
| Identity, computed or rowversion | Leave out (server default) |
| Foreign key | Existing parent key, picked from the parent table's rows |
| Unique integer | Sequence (1, 2, 3…); other integers a Random number that fits the type |
| decimal, money, float | Random decimal that fits the precision and scale |
| bit | Random 0/1 |
| date / datetime | Date or Date and time within the last five years |
| uniqueidentifier | GUID |
| Text named like email, first…, last…/surname, name/contact, phone/mobile/fax, city/town, country, company, url/website | Email, First name, Last name, Full name, Phone, City, Country, Company, URL |
| Other text | Lorem 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.
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.)