Solved

Primary key Vs Unique key

Posted on 2004-09-09
2
4,972 Views
Last Modified: 2008-01-09
Is there any point in declaring a primary key if I already have a unique clustered index on the primary key field(s)?
0
Comment
Question by:billy21
2 Comments
 
LVL 5

Accepted Solution

by:
hkamal earned 350 total points
ID: 12018118
Yes, all tables should have a primary key
This just formalises your structure for inter-entity relationships
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12018444
I agree with hkamal that all tables should have a primary key. I've heard many reasons why people didn't define them for some tables, but I don't buy the arguments. It's a best practice and a good habit. If you define a primary key on a table and it actually never "needed", no harm is done. If you don't define a primary key because you're "sure" it will never be needed, but you turn out to be wrong, great harm can be done. And I've seen a great many databases that were in extremely bad shape because of failures including lack of primary keys where people didn't think they were needed.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now