# How to Visualize SQL Data Lineage Automatically (From a Folder of SQL Files)

> Turn a folder of SQL files or a dbt project into a table and column lineage graph automatically. Free, no database connection, and nothing leaves your browser.

Page: https://datautility.in/blog/sql-lineage-from-a-folder-of-sql-files-and-dbt-models
This is the Markdown copy of the page. The tool itself runs in the browser: your files are processed on your own device and are not uploaded.

Published 2026-11-17 · Analyze & protect · visualize sql data lineage, sql lineage visualization, sql lineage from files, automatic sql lineage, sql lineage tool free, dbt lineage

Drawing lineage by hand works for five tables and fails at fifty. The tables are all described in your SQL already, in every CREATE, INSERT and SELECT, but the answer is spread over dozens of files that nobody reads end to end. Here is how to have the lineage drawn for you from the files themselves, in a couple of minutes.

Open the tool: [SQL Lineage Analyzer](https://datautility.in/sql-lineage-analyzer)

## What "automatic" means here

Automatic SQL lineage does not need you to describe anything. A tool reads each statement, notes the tables it reads and the table it creates, joins the files by table name and draws the result. You provide SQL; it provides the map.

Because it works from code, it needs no database connection, no query logs and no credentials. That is what makes it usable on a repository, a ZIP from a colleague or a folder on a laptop.

## Step 1: collect the SQL

Put the files in one folder. Scripts, migrations, view definitions, load files and dbt models are all fine. If you have a single long script, paste it into the box instead. The [SQL lineage analyzer](https://datautility.in/sql-lineage-analyzer) accepts a folder, a ZIP, several .sql files or pasted text, up to 3,000 files of 5 MB each.

## Step 2: drop it into the analyzer

Drag the folder onto the page. A pop-up confirms how many files were read. The analysis runs in your browser, so the SQL is not uploaded. Within a second or two you see a graph and a row of numbers: files, statements, tables, views, sources, table links and column links.

## Step 3: read the graph

Tables and views flow from left to right, from raw tables to final outputs. Dashed cards are source tables: tables your files read but never create, which are usually your raw data. Colours reflect the schema or folder a table belongs to.

Click a table and its path lights up. Use Upstream to see what it is built from, Downstream to see what depends on it, or Both for the whole neighbourhood.

## What the tool reads

To be useful on real code it must understand more than a plain SELECT. Data Utility reads:

- CREATE TABLE and CREATE VIEW, including CREATE TABLE AS.

- INSERT ... SELECT, MERGE, UPDATE ... FROM and SELECT INTO.

- CTEs, subqueries, joins and UNION.

- The bodies of stored procedures.

- dbt ref() and source() calls, with a SELECT-only file treated as a model named after the file.

Quoted names in double quotes, backticks and square brackets work, so common warehouse dialects such as Postgres, Snowflake, BigQuery, Redshift, Databricks, MySQL and SQL Server are covered for the ANSI core.

## Step 4: go down to columns

Open the Columns tab, choose a table and click a column. You see the source columns it is built from and the columns that depend on it. Each link is marked copied or calculated, and the expression is available on hover. This is column-level lineage read from the SQL, and it is best effort.

## Step 5: use the extra views

The Run order tab lists the files in a sensible order to run them, each after the files that create the tables it reads. The Issues tab lists circular dependencies, tables created but never read, and statements that could not be read. The Tables tab gives a sortable list with how many tables each one is built from and feeds.

## What it cannot follow

Automatic does not mean complete. Dynamic SQL built from strings at run time cannot be followed, and tables created by tools outside your files will appear as sources. A SELECT * is only expanded into real columns when the source table is defined with its columns in your files. Jinja that generates table names will give a partial graph. The Issues tab tells you what was skipped.

## A real-world use: before a migration

You are moving a warehouse to a new platform. Drop all scripts into the analyzer, sort the Tables tab by "feeds", and you immediately see which tables everything depends on. Those are the ones to migrate and test first, and the Run order tab gives you the sequence to load them in.

## Save and share

Open Export to save a PNG or JPG, copy the picture, or copy a share link that carries the SQL inside the address. Nothing is stored on a server. This makes it easy to attach lineage to a ticket or a design document.

## Where to go next

To understand the concept behind the graph, read [what SQL data lineage is](https://datautility.in/blog/what-is-sql-data-lineage-a-practical-guide). To apply it to a dbt project, see the [free dbt lineage visualizer](https://datautility.in/blog/dbt-project-visualizer-free-see-your-models-as-a-graph).

## How to use the SQL Lineage Analyzer: step by step

1. Put your SQL files or dbt models in one folder or ZIP.
2. Drop it into the SQL lineage analyzer.
3. Click a table to follow it, then open Columns to trace a column.

## When to use the SQL Lineage Analyzer

- Map a warehouse from its scripts
- Plan a migration
- Document a data flow automatically
- Onboard a new engineer

## Example

Input:

```
models/ folder: raw schema, staging views, marts, reports (7 .sql files)
```

Output:

```
A graph of 10 tables and views, 40 column links and the order to run the files
```

## Frequently asked questions

### How do I visualize SQL data lineage automatically?
Drop a folder of SQL files, a ZIP or a dbt models folder into a lineage tool that reads SQL. It finds the tables each statement reads and writes, joins the files by table name and draws the graph.

### Does it need a database connection?
No. It reads the SQL text only, so it needs no connection, credentials or query logs.

### Which SQL statements does it understand?
CREATE TABLE and VIEW, CREATE TABLE AS, INSERT ... SELECT, MERGE, UPDATE ... FROM, SELECT INTO, CTEs, subqueries, joins, UNION, stored procedure bodies and dbt ref() and source().

### Is my SQL uploaded?
No. The files are analysed in your browser and never sent to a server.

Tip: Drop the top-level folder so file paths stay meaningful and tables from different folders are joined by name.

## Related tool pages

- [dbt Lineage Viewer for Your SQL Models](https://datautility.in/dbt-lineage-viewer): Drop your dbt models folder and see the lineage graph from sources through staging to marts, with column links. No dbt run, no warehouse. Free, private.
- [SQL Column Lineage Tool](https://datautility.in/sql-column-lineage-tool): See which source columns build every column of a view or table across many SQL files. Trace to the raw table or forward to dependants. Free, in your browser.
- [SQL File Dependency Analyzer](https://datautility.in/sql-file-dependency-analyzer): Find out which SQL file must run before which, from the tables each file creates and reads. Get a run order, circular dependencies and tables nothing uses.
- [SQL Impact Analysis: What Breaks If a Table Changes](https://datautility.in/sql-impact-analysis): Pick a table and see everything downstream that depends on it, and every upstream source it is built from. Works across a whole folder of SQL files, free.
- [SQL File Lineage Tool](https://datautility.in/sql-file-lineage): Free SQL file lineage tool: drop a folder of .sql files and see which file feeds which table, column by column. Nothing is uploaded.
- [SQL Query Visualizer](https://datautility.in/sql-query-visualizer): Free SQL query visualizer: paste a query or drop SQL files and see tables, joins and columns as a clear diagram. Runs in your browser, no upload.

## Also try

- [What is SQL data lineage?](https://datautility.in/blog/what-is-sql-data-lineage-a-practical-guide)
- [Trace data through SQL files](https://datautility.in/blog/sql-file-lineage-trace-data-through-your-sql-files)
- [Visualize joins, CTEs and subqueries](https://datautility.in/blog/visualize-sql-joins-ctes-and-subqueries)

## More guides

- [Data Profiler: Check Data Quality Before You Use It](https://datautility.in/blog/data-profiler-check-data-quality)
- [Compare Two CSV or Excel Files: Find Added, Removed and Changed Rows](https://datautility.in/blog/compare-two-csv-files-find-differences)
- [Data Masking: Hide Emails, Phones and Names Before Sharing](https://datautility.in/blog/data-masking-hide-emails-phones-pii)
