I'm using a Unique Key constraint for the first time, and I think I may not be understanding something correctly. I have a table with a Primary key (media_format_id) that is auto-increment. Then I have 3 fields which are Foreign Keys, that I also added a Unique constraint to. I do not want any 2 records with the same value combination for those three fields (media_id, format_id, lang_id).
Here is the sp_help for my table (view attached image):
IX_multimedia_formats
nonclustered, unique, unique key located on PRIMARY media_id, format_id, lang_id
PK_multimedia_formats
clustered, unique, primary key located on PRIMARY media_format_id
I use a stored procedure to create the records, and another to update them. Create works fine (unique constraint and all), but during update, I get the Violation of Unique Key contraint error every time.
Can anyone point me in the right direction ? Thank you