Import DDL into an ER diagram you can edit

Redrawing an existing database means typing every table and key again. ERDsmith reads the DDL the database already has and builds the model from it, keys and relationships included.

CREATE TABLE [shop].[Room] (
    [RoomId] INT           NOT NULL,
    [Name]   NVARCHAR (60) NOT NULL,
    [Seats]  SMALLINT      NOT NULL,
    CONSTRAINT [PK_Room] PRIMARY KEY CLUSTERED ([RoomId] ASC)
);

CREATE TABLE [shop].[Equipment] (
    [EquipmentId] INT           NOT NULL,
    [RoomId]      INT           NOT NULL,
    [Name]        NVARCHAR (80) NOT NULL,
    CONSTRAINT [PK_Equipment] PRIMARY KEY CLUSTERED ([EquipmentId] ASC),
    CONSTRAINT [FK_Equipment_Room_RoomId] FOREIGN KEY ([RoomId])
        REFERENCES [shop].[Room] ([RoomId])
);
The script. Two tables as the database writes them: Room, and Equipment with its foreign key to it.
shop.Room and shop.Equipment joined by a relationship; shop.Equipment has RoomId (FK), an int like the key of shop.Room.
The model. The same tables after Import: the keys, the types and the relationship, ready to edit.

01 · Source

A script, a folder or a paste

Choose a script file, a folder of table files, or paste the DDL into the editor. The tables come in on the diagram in front.

The Import DDL tab's Source: Read from A script file, new-tables.sql chosen; A folder of table files and Pasted into the editor below it.

02 · Preview

See what changes before it changes

Preview reads the script into a copy of the project and lists what it creates, replaces, alters and drops. Nothing changes until Import, and Import is one undo step.

The Preview: 2 tables created, 1 statement skipped; shop.Room and shop.Equipment under Created, then the skipped view, each in the Output with a link to its line.

03 · Skipped

What it skips is listed

A statement the model has no place for, a view or a procedure, is banded in the script and listed with its line in the Output. Statements that only set up a session, such as SET or USE, are passed over.

The script after Preview: the CREATE VIEW of shop.RoomSeats banded yellow, with a warning mark in the gutter at its line.

04 · Change scripts

Run a change script on the model

Import runs into the open project as the database would run it: ALTER TABLE, DROP and renames apply to the tables already there, in the script’s order. The Preview lists each table it alters with what changes, a column added or renamed.

The Preview of a change script: 2 tables altered; dbo.Member renames Bio to About, shop.Workshop adds Level.

By hand or imported

By handIn ERDsmith
Tables and keystyped again from the databaseread from its CREATE TABLE script
Relationshipsdrawn line by linedrawn from the foreign keys, composite keys included
What it can't readunknown until something is missingviews, procedures and data skipped and listed in the Output
A change scriptapplied to the drawing by handALTER, DROP and renames replayed on the model in order
A name the project already hasfound when the database refuses ita table of that name is replaced whole; any other name is shown before Import, which stays off

More on this