A naming guideline is easy to write and hard to keep by hand, and a constraint left to SQL Server gets part of its table’s name and a hex number. The Naming templates feature page shows SQL Server’s names beside the names the templates give.
The editor keeps names as you design
Every name that follows a template is rebuilt from the objects it names whenever they change, and the Output lists each rename in the entry of the change that caused it.
Rename shop.Workshop to Course and four names follow: its primary key PK_Workshop becomes PK_Course, its check CK_Workshop_Capacity becomes CK_Course_Capacity, its default DF_Workshop_Category becomes DF_Course_Category, and the foreign key in shop.Session, FK_Session_Workshop_WorkshopCode, becomes FK_Session_Course_WorkshopCode.



A key change works the same way. Add DisplayName to the alternate key AK_Member_Email and the key becomes AK_Member_Email_DisplayName. Add StartsAt to the primary key of shop.Session and PK_Session keeps its name, as PK_{Table} has no columns in it, but the column is carried into shop.Booking, whose foreign key FK_Booking_Session_WorkshopCode_SessionNo becomes FK_Booking_Session_WorkshopCode_SessionNo_StartsAt.

Two objects can need the same name. A second index on MentorId in dbo.Member would be IX_Member_MentorId too, so it takes the next number:

Every template and its tokens
Click the cog beside Model, above the tree. The project settings open in the panel on the right, and Naming is their last section, after General and SQL Server: a field for each template, and under it a preview, a real name from your project and the object it names. A template is text with tokens in braces. The defaults, each with its name on the makerspace demo:
- New key column
{Table}Id, the first key column added to shop.SessionSessionId. Takes{Table},{TableSingular}.- Primary key
PK_{Table}, on shop.SessionPK_Session. Takes{Table},{TableSingular},{Columns},{ColumnsConcat},{FirstColumn}.- Alternate key
AK_{Table}_{Columns}, on dbo.MemberAK_Member_Email. The same tokens.- Foreign key
FK_{Table}_{ParentTable}_{Columns}, from shop.Session to dbo.MemberFK_Session_Member_HostId. Those tokens and{ParentTable},{ParentTableSingular}.- Index
IX_{Table}_{Columns}, on shop.SessionIX_Session_HostId. The primary key's tokens.- Default
DF_{Table}_{Column}, on dbo.MemberDF_Member_JoinedOn. Takes{Table},{TableSingular},{Column}.- Check
CK_{Table}_{Columns}, on shop.WorkshopCK_Workshop_Capacity. The primary key's tokens; a check's columns are the columns its expression names in brackets:[Capacity] > 0givesCK_Workshop_Capacity.- Foreign key column
{ParentColumn}, in shop.Session from shop.WorkshopWorkshopCode. Takes{ParentColumn},{ParentColumnPrefixed},{ParentTable},{ParentTableSingular}.
What each token gives, with its value on the demo:
{Table}- The table's name:
Sessionon shop.Session. {TableSingular}- The table's name in the singular. The demo's names are singular already:
Session. {Columns}- The object's columns joined by
_:WorkshopCode_SessionNofor the primary key of shop.Session. {ColumnsConcat}- The same columns run together:
WorkshopCodeSessionNo. {FirstColumn}- The first of them:
WorkshopCode. {ParentTable}- The table a foreign key references:
Memberfor the host of a session. {ParentTableSingular}- That table's name in the singular:
Member. {Column}- A default's column:
JoinedOn. {ParentColumn}- The column a foreign key column references:
WorkshopCode. {ParentColumnPrefixed}- The parent table's singular name before the parent column, unless the column starts with it already:
WorkshopCodestaysWorkshopCode, and a reference todbo.Author.IdbecomesAuthorId.
A token with no value takes the _ before it along, so a check that names no column in a table Orders is CK_Orders.
Presets side by side
Preset fills every template at once. ERDsmith (IDEF1X keys) is the default above. EF Core keeps the same key, constraint and index templates, names a new key column Id and foreign key columns {ParentColumnPrefixed}, as Entity Framework Core expects. The difference shows on a schema keyed Id: two parents, dbo.Author and dbo.Book, and a child dbo.Review, each with an Id key, and a relationship drawn from each parent to the child.
-- dbo.Review: ERDsmith (IDEF1X keys)
Id: PK, FK to Author, FK to Book
PK_Review
FK_Review_Author_Id
FK_Review_Book_Id-- dbo.Review: EF Core
Id: PK
AuthorId: FK to Author
BookId: FK to Book
PK_Review
FK_Review_Author_AuthorId
FK_Review_Book_BookId

Under ERDsmith (IDEF1X keys) both relationships want a column named Id, and the child already has an Id of the same type, its own key. Drawn identifying, both take it: the child’s own key column becomes the foreign key to both parents as well. Drawn non-identifying, ERDsmith asks for a role name instead, as a non-identifying relationship never takes a key column. Under EF Core the child gets AuthorId and BookId. The role names page covers this case. On the demo, applying EF Core renames two names: shop.Booking.WorkshopCode, which references shop.Session, becomes SessionWorkshopCode, and its foreign key becomes FK_Booking_Session_SessionWorkshopCode_SessionNo.
A preset changes nothing until you apply it; templates that match no preset read Custom.
Change a template
- Type the new template. The field turns orange, its label says “changed, not applied”, and the preview shows the new name beside the one it has now. Type
{to list the tokens that template takes, each with its value on the preview’s object; pick one with the arrow keys and Enter, Tab or a click. - The bar under the templates counts what applying would do.
- Apply changes renames every name that follows the template, in one step you can undo. The Output lists each rename.



A template with an error can’t be applied: an unknown token (ERDsmith names the nearest one), or a key or constraint template without {Table} or {TableSingular}, since those names must be unique in their schema. A warning, such as an index template without a columns token, still applies.
Names you set yourself
Type a name on a key, constraint or column that differs from what its template gives, and it is yours. Its field ends in an orange broken link; a name that follows its template ends in a grey link instead. A changed template leaves your names alone, and the Output counts them: “0 set by you kept” above. A click on the broken link, or a blank field, gives the name back to its template. To give back every name of one kind at once, click Reset beside its template in the project settings (“Reset 2 names”): a dialog lists each rename first.

Long names and clashes
SQL Server allows 128 characters in a name. With Shorten long names on, a longer generated name is cut to 128 characters, the last one ~. A name already taken in its scope takes the next number, as IX_Member_MentorId1 did above, and loses it when the clash goes.