One table, two unique keys (1 Viewer)

GSevensM

Registered User.
Local time
Yesterday, 23:03
Joined
Apr 2, 2014
Messages
25
All,

Do you know if there is any way on a table that I can have a unique identifier over two fields? E.g.

I have a login ID and a Domain field in a table with sample data below.

Login Domain

John Test
Jane Test
Fred Live
John Live

The login names need to be unique to the domain so the integrity cannot be breached. This has to fit into one table (although the domain is actually being pulled from a look up table so is in fact a numerical value) for ease of form creation.

Any suggestions would be gratefully received....
 

ButtonMoon

Registered User.
Local time
Today, 07:03
Joined
Jun 4, 2012
Messages
304
two unique keys

Just to be clear on the terminology: that is not two keys, it's one key consisting of two attributes AKA a composite key. I suggest you avoid the term compound key because in some contexts that means something different.

Two keys would mean two attributes (or more generally two sets of attributes) each of which had separate uniqueness constraints, i.e. each column required to be unique in its own right.
 

Users who are viewing this thread

Top Bottom