Let say that I have table TableA(ColumnCode, ColumnA2, ColumnA3, ColumnA4, ColumnA5).
Note: ColumnCode(PrimaryKey)is not autoincrement. What I want to prevent is following scenario:
INSERT INTO TableA VALUES(1111, 'val1a', 'val2a', 'val3a', 'val4a', 'val5a')
Next insert is with the same values but different ColumnCode:
INSERT INTO TableA VALUES(1234, 'val1a', 'val2a', 'val3a', 'val4a', 'val5a')
The thing is that I want to prevent inserts like this, where I might have these situations of inserting same values just for another ColumnCode.
Any idea?
Note2: Next insert is not a problem because I'm not inserting ALL the same column values!!!
INSERT INTO TableA VALUES(1456, 'val1a', 'val2a', 'val3a', 'val32a', 'val654a')
As shown, set(ColumnA2, ColumnA3, ColumnA4, ColumnA5) of values is not a duplicate. ColumnA4 and ColumnA5 values are different. So, for me, a duplicate is only when all four of ColumnA values are in table under any ColumnCode.
Hope I cleared my question a bit?