I have a table with 2 primary key columns :
isIdentity = Yes
You have a compound primary key on
StudentID. That means you the combination of ID and StudentID together must be unique. Since
ID is an identity column that combination of
StudentID will always be unique (because
ID is already unique on its own).
You can change the primary key to be on
ID only. Then you can add a unique index on
StudentID. For example:
create unique index idx_studentID on yourTable(StudentID)
That will insure that the StudentID column, in fact, contains only unique values.
It seems like you may not actually need
ID column, but that's a little wider discussion than your original question.