How to Create Unique Key on the columns?

 Posted by vishalneeraj-24503 on 10/7/2014 | Category: Sql Server Interview questions | Views: 846 | Points: 40

We have to write Unique keyword after Datatype as:-
Create Table Table_Name(Col1 DataType Unique(ID),Col2 DataType);

For Example:-
Create Table Employee_Master(Emp_Name varchar(20),PAN_Number varchar(10) Unique,Address Varchar(100),Phone_Number int);

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response