Articles → SQL SERVER → Unique index in SQL server

Unique index in SQL server






Purpose of unique index









Syntax


CREATE UNIQUE INDEX index_name ON table_name (column_name)



Example





Click to Enlarge



CREATE UNIQUE INDEX idx_unique_SampleTable_Test ON SampleTable (Test)




insert into SampleTable values(null)
insert into SampleTable values('value1')
insert into SampleTable values('value2')
insert into SampleTable values('value1')



















Posted By  -  Karan Gupta
 
Posted On  -  Sunday, January 01, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250