I wrote code like
ALTER TABLE [dbo].[Questions]
ADD 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.
Please help me..
I wrote code like
ALTER TABLE [dbo].[Questions]
ADD 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.
Please help me..
ALTER TABLE [dbo].[Questions] ADD constraint q_pk UNIQUE (Question);
ALTER TABLE [dbo].[Questions] ADD UNIQUE (Question); Column 'Question' in table 'Questions' is of a type that is invalid for use as a key column in an index.
In Question-column of table Questions should not be 'nvarchar(MAX)' but i have
given before table schema question as nvarchar(max) so it gives such error
Questions' is of a type that is invalid for use as a key column in an index.
I have changed to varchar(255). Its working fine. Thanks.