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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importance of Primary Keys

Status
Not open for further replies.

shiningblade

Programmer
Jan 25, 2002
25
0
0
CA
How important are primary keys in a SQL Server database? I know someone who says it is common practice not to use them. Is he out to lunch?
 
Well, he may not be out to lunch, but probably a long coffee break.

I guess you'd have to do a large-sample survey to determine what "common practice" is, but leaving out primary keys as a matter of policy is certainly not the textbook approach. --------------
Low Cost Prints:
 
Anytime that I have gotten lazy and not created a primary key, I have regretted it later! Sooner or later you will always need a way to uniquely identify a particular record!

Your friend might be right that many people don't use them. However, there are many poorly designed databases operating out there too. Just because other people do something doesn't make it a good practice.

 
Probably not out to lunch but if he worked for me he would be out of a job. :) Seriously you should always have a primary key even if it is just an identity field.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top