Primary Key

<< Click to Display Table of Contents >>

Navigation:  View Indexes > Examples Usage >

Primary Key

To find tables with no primary key sort by the primary key column

 

Sort on the Primary Key column

Sort Ascending to show Heap tables

Sort descending to show primary keys that are on non clustered indexes.

 

 

Primary Key (PK) Icons

 

Table Level

At the table level the icons displayed are

 

       No icon, there is no primary key on the table

key default        PK is Clustered Index

key warn        PK is NOT Clustered Index

 

 

Column Level

At the column level the icons displayed are

 

       No icon, the column does not belong to the PK

key default ascN        Order ascending,   PK is a Clustered Index

key default descN        Order descending, PK is a Clustered Index

key upN        Order ascending,   PK is NOT Clustered Index

key downN        Order descending, PK is NOT Clustered Index

 

 

 

In the example below you can see there is no primary key on the table dbo.Heap -there is no icon.

 

 

The table dbo.HeapTable does not have a check box. This means there is no index on this table.

 

 

pkmissing

 

Note

It is possible to have one or more non clustered indexes on a heap table (no clustered index on the table). In this case the screen shot would show-

No icon in the primary key column

A check box next to the table name indicating there is at least one index on the table

 

sorting the column Primary key descending.

pkncindex

 

 

 

PK detail on Column level

 

At the column level a key icon is shown where the column belongs to the primary key. Next to the icon is a number this represents the position in the primary key.

 

Example.

The key icons below are yellow indicating the PK is on a non clustered index. If the key icon was green this would indicate the PK is on a clustered index.

 

Notice the columns ModifiedDate and Primary in the table Production.ProductProductPhoto are not part of the primary key as there is no icon, also as there is no check box next to the column names meaning there are no indexes on those columns.

pknccolumn