r/SQLServer • u/One-Protection-3169 • Jun 20 '26
Discussion Got tired of faker scripts breaking on FK-heavy schemas, so I built something
Anyone else dealt with this — you need test data for a dev/staging SQL Server environment, prod is off-limits for compliance reasons, and the moment you write a generic Faker/Bogus script, it falls apart because half your tables have foreign keys pointing into each other?
I kept hitting this on a few projects. Manually scripting INSERT order to respect FK dependencies got old fast, and most "fake data" tools out there are flat — they don't actually understand your schema's relationships.
So I built a small tool that:
- Takes a JSON export of your SQL Server schema (tables, PKs, FKs, identity columns — there's a T-SQL script that generates this for you)
- Lets you define simple rules per column (ranges, value lists, email/phone formats, etc.)
- Outputs a dependency-ordered SQL script or CSV files, so inserts always respect FK order
- Runs locally — no writes to your actual database, no data leaves your machine unless you choose to use it that way
It's deterministic too, so the same seed always regenerates the same dataset (useful for repeatable tests/CI).
Genuinely curious if this is a problem others here still deal with, or if you've got a better way to handle it already
Happy to share the playground link if anyone wants to poke at it with their own schema.
here is the website - https://sql-lyart.vercel.app/
here is the github repo link- https://github.com/daxx06/sql
i just want to know if this is helpful in any sort of way , sorry if i wasted your time
