How to assign Unique key to any column in the table at design time?

 Posted by vishalneeraj-24503 on 3/6/2014 | Category: Sql Server Interview questions | Views: 594 | Points: 40
Answer:

Suppose,i want to create Table called Employee_Master and to assign a unique key to PAN_Number and Employee_Code column,just give Unique keyword after datatype as

create table Employee_Master

(
Employee_Id int primary key,
Employee_Name varchar(50),
PAN_Number varchar(10) Unique,
Employee_Code varchar(25) Unique
)


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response