Follow in Twitter & Facebook



Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools



Friday, March 16, 2012

Primary Key,Unique Key SQL Server 2008

Here we will discuss what is primary key, unique key in SQL Server 2008 and What is the difference between primary key and unique key in SQL Server 2008. You can also check What is Connection Pooling in Asp.Net ?

Primary key:
(1)-Primary key is(Unique key+not null).

(2)-There must be one primary key can be present inside a table.

(3)-It doesn't support null values .

(4)-It doesn't support duplicates.

(5)-Primary key allows each row in a table to be uniquely identified and ensures that no duplicate rows exist.

(6)-Clustered index is created in Primary key.

Unique key:
(1)-There may be more than one unique key can be present inside a table.

(2)-It supports null values.

(3)-But it doesn't support duplicates like suppose inside column there are two null values then SqlServer internally give some different values but values are not equal.

(4)-Unique key constraint is used to prevent the duplication of key values within the rows of a table and allow null values.

(5)-Non-Clustered index is created in unique key.

You can also see some SQL Server articles here.




0 on: "Primary Key,Unique Key SQL Server 2008"