Home > Blogs > UNIQUE versus PRIMARY KEY contstraints

UNIQUE versus PRIMARY KEY contstraints

By  Aug 18, 2008

Topics: Data

If you need to enforce a column to have unique values, there are a couple of choices you have to enforce that. One is the UNIQUE constraint, and the other is to make the column a primary key.

While both of them will do the job, there's a difference between them. A UNIQUE constraint will allow you to have a NULL value, but a primary key won't. This is important to remember when you're designing your tables.

More here: http://www.informit.com/guides/content.aspx?g=sqlserver&seqNum=60

Become an InformIT Member

Take advantage of special member promotions, everyday discounts, quick access to saved content, and more! Join Today.