Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to alter table add Unique key in my database table Question has NOT NULL KEY ALREADY
That table does contains distinct data

ALTER TABLE [dbo].[Questions] ADD constraint q_pk UNIQUE (Question);
.

But it shows error like
Column 'Question' in table 'Questions' is of a type that is invalid for use as a key column in an index.
Posted
Comments
Maciej Los 21-May-14 2:08am    
Not enough information...

1 solution

Please, read my comment to the question.

Have a look here:
ALTER TABLE[^]
Create Unique Indexes[^]
 
Share this answer
 
Comments
[no name] 24-May-14 20:44pm    
enough for 5
Maciej Los 25-May-14 4:12am    
Thank you, Bruno ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900