Solved

Primary key Vs Unique key

Posted on 2004-09-09
2
4,973 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
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…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

895 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

14 Experts available now in Live!

Get 1:1 Help Now