Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

primary key 1

Status
Not open for further replies.

hoofit

Technical User
Nov 20, 2005
343
US
I have a table where not using a primary key would help. If I set the field indexed yes w/ no dupes, does this prevent duplicates adequately?
Thank you

hoofit
 
I have a table where not using a primary key would help.
How would it help?
If I set the field indexed yes w/ no dupes, does this prevent duplicates adequately?

It should.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
The only difference you'll see is that a regular no-duplicates index will allow null values in the field and will allow any number of records to have null values. A primary key forbids nulls.

But I'm with Greg - how does it help if you don't have a primary key?

Geoff Franklin
 
I see. I cannot allow any number of records to have nulls so I will need to use a primary key.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top