I have a table with a Description field. I want to ensure that no two rows have the same “Description,” but I can’t make Description into my identity column (my ID column is an int).
Is it safe to set Description as a second primary key (in addition to my ID which is already a primary key)?
Add a Unique index to the Description column.
Using Sql Server Management Studio right click on the table and choose Design. Then right click on a column and choose “Indexes/keys”. You will be prompted with the following window
Click on Add on the bottom left and then specify properties for your index. If you want to use a DDL script then use something like this