2 primary Keys in 1 table
How do I create 2 primary keys in 1 table in vb05ee. I know this can be done because I am looking at a table sample with 2 primary keys in it.
Help
How do I create 2 primary keys in 1 table in vb05ee. I know this can be done because I am looking at a table sample with 2 primary keys in it.
Help
You can't create two primary keys in a table in SQL. Are you sure its 2 primary keys or is it two fields which make up a primary key.
You could create a primary key and a unique key or two unique keys - but by definition there is only one Primary Key.
Also VB 2005 Express edition is a development environment which supports two database - Access and SQL Express. The same applies to both database but to provide more specific details - you need to provide more information about which you are using.
In the designer select the columns that you want to set as Primary Keys and then right click and select
"Set Primary Key"...this action will set all selected columns to the Primary Key![]()
You and spotty are technically correct about the composite key....However the answer to the question is as stated above...The designer uses the terminology "primary key" no matter how many columns you are setting at the time...
SO there maybe 1 primary key but mulitple columns can make up a primary key...and inorder to do that follow the given instructions!!!![]()
The user asked about setting up two primary "keys"
The operative part here is the plural keys - a table cannot have two primary keys.
The designer allows you to select as many fields as you want to create a (singular) primary "Key"
This field can be a single field key or a composite key field but there still can only ever be one primary key.
DMan1 wrote:
spotty wrote:
The designer allows you to select as many fields as you want to create a (singular) primary "Key"
Please take note of my response when I said "THE" primary key....
DMan wrote:
"...this action will set all selected columns to the Primary Key
I'm sure all of this verbose conversation is to help clarify this for all of the noobs who don't know any better
It depends on your defintion of 'is'....![]()
I was simply referring the the title of the thread
"2 primary keys in 1 table"
You cannot have two primary keys in 1 table. You can only have one primary key in a table.