SQL SERVER 2008 – What’s the difference between a primary key and a unique key

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

Reference : Dilip Kumar Jena ( https://sqlexplore.wordpress.com )

Advertisements

One thought on “SQL SERVER 2008 – What’s the difference between a primary key and a unique key

  1. I’ve already been searching for a little bit for any high-quality content pieces on this kind of area . Exploring in Bing I at last came across this web page. Reading this information So i am happy to convey that I’ve a very fantastic uncanny feeling I discovered exactly what I wanted. I most certainly will make certain to do not forget this site and give it a glance regularly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s