Pankaj  Kumar Choudhary

Pankaj Kumar Choudhary

  • 60
  • 26.8k
  • 13.1m

Primary Key

May 21 2015 10:02 AM
Hello Friends I have a problem so please help me.
 
My problem is that we all know that is a table contain a primary key then a clustered index in generate.  A Clustered Index is a special type of index that reorders the way records in the table are physically stored. Therefore the table can have only one Clustered Index.
If a have a table 
 
and i create  a primary key on Emp_Id cloumn then a B-Tree will generate(in Clustered Index)
that store the data in such a way
 We know that in clustered index data always store  in sorted form.  Sorting always performed on the base of primary key. 
 
My Confusion that how data will be sort if we create a primary key on more than one column
like:

Alter Table Employee

Add constraint Constraint_Name Primary Key(Emp_IId,Emp_Age)

 
Please anyone can explain me how data will be store in sorted form........
 
Thanks@@
 
 

Answers (3)