About Table Relationships Within the Database

When Revit creates database tables during ODBC export, it adds relationships to the data tables using primary keys and reference values.

In relational databases, a primary key is a unique value that identifies a record (row) in a table of the database. Reference values are columns in a table that refer to other tables.

Note: Database programs (such as Microsoft® Access) can interpret the table relationships. In spreadsheet programs like Microsoft® Excel, relationships are not supported, so Revit creates simple, unrelated tables.

The primary key in each element table is the column labeled “Id”. The following table illustrates how primary keys and reference values create relationships among tables in the database.

Revit Architecture
Column (Field) of a Door Instance Table Corresponds to...
Id None. This is the unique identifier for this instance of a door.
Type Id Id column of the door Types table
Level Id column of the Levels table
Room Id column of the Rooms table
Key schedule Id column of the Key Schedules table
Revit Structure
Column (Field) of a Structural Column Instance Table Corresponds to...
Id None. This is the unique identifier for this instance of a structural column.
Type Id Id column of the structural column Types table
Level Id column of the Levels table
Room Id column of the Rooms table
Key schedule Id column of the Key Schedules table
Revit MEP
Column (Field) of a Lighting Fixture Instance Table Corresponds to...
Id None. This is the unique identifier for this instance of a lighting fixture.
Type Id Id column of the lighting fixture Types table
Level Id column of the Levels table
Room Id column of the Rooms table
Key schedule Id column of the Key Schedules table

The primary key in the Assembly Codes table is the Assembly Code column. The Assembly Code column in type tables references the Assembly Code column in the Assembly Codes table.

Revit does not create a reference for the Host Id column because the host may be a wall, floor, roof, or other such host, so there is no unique table to reference.

The relationships between tables are established only when Revit first creates the tables; if you use Revit to re-export to an existing database, no new relationships are created.