Alternatives to SSMS database diagrams, and when you still want them
Right-click Database Diagrams in SQL Server Management Studio, pick your tables, and you have a picture of your schema in under a minute. It costs nothing, it needs nothing installed, and for a small database you own it is still a reasonable answer.
It is worth knowing what it does, though, because three of the things it does are not obvious from the menu.
What SSMS diagrams cost
They put objects in your database. Diagramming has to be set up by a member of db_owner, and
setting it up adds a sysdiagrams table along with stored procedures and a function. The diagram
itself is then stored as a row in that table — inside the database it describes, travelling with
every backup and restore of it.
To see whether a database already carries them:
SELECT name, type_desc
FROM sys.objects
WHERE name IN ('sysdiagrams', 'fn_diagramobjects', 'sp_creatediagram', 'sp_helpdiagrams',
'sp_alterdiagram', 'sp_dropdiagram', 'sp_renamediagram', 'sp_helpdiagramdefinition')
ORDER BY type_desc, name;
No rows means diagramming has never been set up there. If you are not db_owner, that is also as
far as you get.
The diagram belongs to whoever drew it. Each diagram has exactly one owner. Other users cannot
open it — only its creator and members of db_owner see it at all. A diagram is therefore a poor
way to explain a schema to the rest of a team, which is usually why somebody drew one.
Edits apply to the real schema. The designer is not a sketchpad. Change a column in it, press save, and the change is made to the database. There is no script to read first, no list of what is about to happen, and on some changes SQL Server rebuilds the table to do it. That is fine on a development copy. It is a different proposition against anything you cannot restore in five minutes.
When they are still the right answer
- One database, you are
db_owner, and you want a picture in the next sixty seconds. - You are working on a development copy where applying a change immediately is what you want.
- You are already in SSMS and installing anything else is more trouble than the diagram is worth.
Nothing below beats it on speed for that.
What else there is
SchemaSpy — a standalone Java tool, also available as a Docker image, that reads a schema's metadata and generates interactive HTML documentation with entity-relationship diagrams. It needs only read access, and it is the usual answer to "our documentation should be regenerated on every deployment", because it runs in CI perfectly well. It documents; it does not edit.
ChartDB — open source, runs in a browser, builds a diagram of a schema and lets you edit the model and export DDL. Good where you want something self-hosted and visual without a licence.
dbdiagram.io and DrawSQL — text-first design tools. You write the schema as DBML, or import a
.sql file, and get a diagram out. These are built for designing a schema you do not have yet
rather than exploring one that already exists; importing from a live database goes through a CLI or
a dump file rather than a connection.
draw.io and Lucidchart — general diagramming. Nothing reads your database, so the picture is accurate on the day somebody drew it and slowly stops being true afterwards. Still the right tool for a slide.
WoodFireERD — ours, so read this part with that in mind. It reads a live database or a DACPAC with read permission only, and writes nothing back: changes come out as a T-SQL migration script you read and run yourself. The diagram starts at one table and grows outward as far as you follow it, which is the part that matters on a schema of several hundred tables, where drawing everything produces a wall nobody can read. See what it does.
Choosing between them
- A picture, right now, of a database you own — SSMS diagrams.
- Documentation that regenerates itself — SchemaSpy.
- Designing a schema that does not exist yet — dbdiagram.io or DrawSQL.
- A diagram for a slide or an architecture document — draw.io or Lucidchart.
- Understanding and changing a large schema that already exists, without the tool touching it — WoodFireERD.
The question underneath all of them is whether you are drawing a schema or reading one. Tools built for drawing are faster to start with and go stale the moment the database changes. Tools that read the database tell you the truth, and the better ones never write to it.