When to use a primary key 

When to use a primary key

Use an automatic number as the Primary Identifier Key.

For each table, use only one field, as the primary key and linking field, to other tables. This becomes the unique identifier, for every record. It is the only linking field, to other tables. Never use data as the primary key.

[b][link=http://cgi.silverbelly.plus.com/showpads.php?sort=Title&cat=All&search=Description&string=mdi&match=Any]Intranet solutions[/b][/link]
[b][link=http://cgi.silverbelly.plus.com/showpads.php?sort=Date&cat=All&search=Description&string=mdi&match=Any]Inventory Software[/b][/link]
[b][link=http://cgi.silverbelly.plus.com/showpads.php?sort=Size&cat=All&search=Description&string=mdi&match=Any]Asset tracking software[/b][/link]
[b][link=http://cgi.silverbelly.plus.com/showpads.php?sort=Company&cat=All&search=Description&string=mdi&match=Any]information management[/b][/link]
[b][link=http://cgi.silverbelly.plus.com/showpads.php?sort=Category&cat=All&search=Description&string=mdi&match=Any]report viewer[/b][/link]

In Practice.
Companies often use a company-created ID, to link relational data together. This is not recommended. Ideally, as a reference, a table linking field never changes.

Suppose a company wants to change an ID, as the company grows. At first it seems OK. However, as time passes, it becomes clear the ID system is outdated.

Now, the company has millions of records, in active and history tables to change. Since this ID was used as a linking field, all the data using the ID needs to change. With millions of records, this is no easy task. Add to this all the code referencing these ID's, in different company software.

Recommended.
Use an automatic number as the primary key, to identify and link. This avoids worrying about the above situation. This saves time, money, and energy.

Return to Main Page

Comments

Add Comment




On This Site

  • About this site
  • Main Page
  • Most Recent Comments
  • Complete Article List
  • Sponsors

Search This Site


Syndicate this blog site

Powered by BlogEasy


Free Blog Hosting