r/SQL • u/Fancy-Newspaper2991 • Jun 22 '26
SQL Server I was struggling with 100+ line legacy SQL queries at work, so I built a simple tool to visualize their data flow
Hey everyone
I wanted to share a tool I built to solve a problem I've been facing at my job.
Lately, I’ve been forced to deal with messy legacy SQL queries and stored procedures that are over 100 lines long. I had no idea what half the tables did, where the data came from, or how it joined together. It was just exhausting to track the flow by scrolling through a wall of text.
I just wanted something simple to show me the visual flow of the query, so I built **Query-Flow** (part of Quackalytics).
It takes your SQL and turns it into an interactive map of nodes and connections so you can actually see the data lineage.
Since company queries can be sensitive, everything runs strictly inside your browser. No data ever touches a server, so it's 100% private.
I deployed it for free on Vercel just to help myself and anyone else dealing with this issue. I also added a couple of other micro-tools I use in my day-to-day.
If you want to test it out with your queries, here is the link: https://quackalytics.vercel.app/sql-flow
Would love to hear your thoughts!
48
u/Blomminator Jun 22 '26
Over a 100 lines?! That's ridiculous!
27
u/AreetSurn Jun 22 '26
You built, or an LLM built?
9
u/zbignew Jun 22 '26
I can’t imagine creating this tool without including a linter/prettyprinter for the code itself.
Even in your screenshot, the diagram spills off the page - I’d learn 10x more from prettyprinting that SQL than I would from any query visualizer.
If you’re turning a multi-step stored procedure into a data flow diagram that shows the interaction between multiple queries, awesome.
If you’re just diagramming every select that leaks out of a stored procedure… and you’ve tagged this w SQL Server… why aren’t you using the tools from Microsoft that already do this?
1
u/lolcrunchy Jun 22 '26
The alternative is to send that code through a linter/formatter so that it's actually readable.
1
u/vbilopav89 Jun 22 '26
Why is it legacy?
What is modern alternative?
1000+ lines client script that works 50 times slower?
4
u/SociableSociopath Jun 22 '26
There are hundreds of tools that already do this, many of them shilled on this very subreddit.
There are also hundreds more that will do what yours is doing and format the query in any number of styles.
Congrats on the tool, but you’re not even in the top 1000 to “solve” this problem and solutions for it predate LLMs
1
u/Wing-Tsit-Chong Jun 22 '26
We printed an SQL query from some code-behind once, in 8pt font. It ran to 45 pages.
1
u/goldPotatoGun Jun 22 '26
If this helps you understand sql better great.
-10
u/[deleted] Jun 22 '26
[removed] — view removed comment