r/SQLServer • u/Simoxmagician • Jun 11 '26
Question How do I generate Data for a Dev Evn
So I have a Database that contains around 350 Tables.
I Need a Tool or a way to generate records for a Dev environment. obviously the tables are related to each other, so I need the generated records to be consistent and coherent with the relational constraints.
Does someone have any suggestions?
3
Upvotes
8
u/Complete-Fondant-202 Jun 11 '26
Also, Invoke-DbaDbDataGenerator in the dbatools.io Powershell package
5
u/gap1284 Jun 11 '26
Can you periodically backup Prod and restore to Dev? Immediately mask any sensitive data after the restore.
This has the advantage of being "real" data. Sometimes issues are data-related and having "real" data helps diagnose them.
3
u/Better-Credit6701 Jun 11 '26
RedGate has a data generator, I believe that dbForge has one as well
1
u/Sea_Pomegranate4303 9d ago edited 5d ago
At 350 tables the pain with Faker is mostly insert order and composite keys, not the fake values. What worked better for us was profiling the existing database and generating from that, so the FKs and rough distributions come for free instead of scripting every table. We actually built something along those lines for SQL Server (Subsetra Lyrebird, disclosure: it's ours), but the profile-then-generate approach is worth it either way on a schema that size.
1
u/rdeheld69 Jun 12 '26
chatgpt , generate a dummy data set for these tables. , (table scripts ) with fk
1
u/TheHelgeSverre Jul 16 '26
Assuming you have a sql dump file, you can use sql-splitter, working on a more complex 'generate' feature where you can configure generational rules, but its not ready yet, but if you can do with redacting and sampling profuction data this will preserve foreign key and relations.
https://www.sql-splitter.dev/cookbook/dev-data-seeding/
Supports mssql, pgsql, mysql and sqlite
1
u/dbrownems Microsoft Employee Jun 11 '26
Also your favorite coding agent can do this. I use GitHub copilot cli.