SQL SERVER · EF CORE
SQL Server database diagrams: import, design, export
Bring a script in, see it as a diagram, change it under SQL Server's rules and take clean DDL back out. In your browser.
01 · Import
Paste a script, get a model
SSMS's Generate Scripts or dotnet ef migrations script. Preview first; anything it leaves out, a view, a trigger, the data, is listed with its line.

02 · Diagram
Every table, key and relationship, drawn
Arranged for you, in crow's foot or IDEF1X, with SQL Server's types and what a SQL Server check finds marked on the table.

03 · Change
Change one thing, the rest follows
Rename Members to Member and seven names follow, every one listed. Foreign key columns keep in step with their keys.


04 · Export
Clean DDL back out
Parents first, each table with its keys. A table SQL Server would refuse is held back with the foreign keys into it; the rest goes out.
SQL Server's data types
Each column takes one of SQL Server's own types, with the length, precision and scale the type has: nvarchar(200), decimal(9, 2), datetime2(3). A foreign key column takes its key's type, length, precision and scale, and follows when the key changes. More in how to pick each column's type.
Checked against SQL Server's rules
The SQL Server check reads the model on every change and marks each table with what SQL Server would refuse. A name over 128 characters (103), a json column in a project set to SQL Server 2022 (2715), a key or unique index on an nvarchar(max) column (1919): each is marked on its table as you make it.

- 1785 two cascade paths
- 1776 a key that isn't a key
- 2749 an identity on a date
- 1761 SET NULL on NOT NULL
- 103 a name over 128
Never built, so there is nothing to mark: 1778 a foreign key column of another type than its key.
SQL projects in and out
Import DDL reads one script, pasted or from a file, or a folder of .sql files, such as a SQL Database Project's, joined and read as one script.
Export DDL writes one script, parents first, or, in Chrome and Edge, a folder with a file per table in the layout SqlPackage writes, rewriting only the files that change.
EF CORE
EF Core migration scripts
- Imports the script
dotnet ef migrations scriptwrites as a diagram, an idempotent one (--idempotent) too. - The EF Core naming preset: a key named
Idgives foreign key columns likeCustomerId, as EF Core expects. - Leaves EF's own
__EFMigrationsHistoryand the data out of the diagram.
More: SQL Server articles · Templates · Docs