Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7565849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:15:44+00:00 2026-05-30T14:15:44+00:00

What unique functionality do Primary Keys provide? While i titled the question with tongue

  • 0

What unique functionality do Primary Keys provide?

While i titled the question with tongue firmly planted in cheek, my question is serious. Before any flames start, I’m not saying build a database without constraints or referential integrity. As far I can tell, however, SQL Server could do away with the primary key key word.

  • Unique indexes cover, well, uniqueness
  • Column based Non-nullability covers the non-nullability requirement for PKs
  • PK’s don’t have to be clustered, so that’s not it
  • Foreign keys can, and often are, implemented with unique indexes, rather than PKs
  • Even MSDN states that a unique index is created to enforce the PK’s uniqueness

I do agree that logically a Primary Key coveys a bit of intention about a data model, but is that it? [sarcasm]Oh, and we do get that little Key icon SSMS shows when designing a table! [/sarcasm]


EDIT

From the comments, it seems clear I didn’t ask this question as clearly as I thought. I agree that primary keys are important from a logical perspective.

I’m not asking:

  • should i choose an int or a varchar for my PK
  • do PK’s have to be clustered, or how do i identify what should be clustered
  • how do i uniquely identify rows

My intention was to ask “what features do PK’s provide that cannot reasonably be implemented using other features?” I’m not suggesting going crazy here — like using a trigger to enforce uniqueness instead of unique constraints/indexes. Reasonable is a key word here — and using a unique index/constraint seems very similar to defining a PK.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:15:45+00:00Added an answer on May 30, 2026 at 2:15 pm

    A completely different perspective :

    SQL is a language that is defined by an ISO standard. That standard has “mandatory” features and “optional conformance” features.

    If you build a DBMS with some data manipulation language, then you are entitled to call your language “SQL” only if :

    (a) you have implemented ALL of the syntax prescribed by the standard (“mandatory” features) , and
    (b) all of the language features that you have implemented (all the mandatory ones as a minimum, but also the “optional” ones you “opted in” for), expose exactly the behaviour as defined/Described in the standard.

    The “PRIMARY KEY” syntax is a very old feature, and it’s not unlikely that it is one of those “mandatory” ones. Ditching the word from your language means you can no longer legitimately call your language SQL. Big commercial vendors are not likely going to make such a move any time soon.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any built-in functionality in vba to get unique values from a one-dimensional
Is there any such thing as a combination of Guava's Cache and Multimap functionality
How unique is the php session id? I got the impression from various things
The unique poll/vote/survey i mean here is, user can only vote once. How do
Is a GUID unique 100% of the time? Will it stay unique over multiple
How to get unique Google Gadget ID from a gadget added to a iGoogle
I have a unique industrial application where I do not want the Windows CE
I have a unique requirement that I hope is possible with LINQ to SQL.
I need a unique GUID that never changes per user in active directory... I
I can get the unique id like className@2345 of my object by calling its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.