I have a Table like this one:
|UserId | ContactID | ContactName --------------------------------------- | 12456 | Ax759 | Joe Smith | 12456 |
You can add unique constraint tou your fields:
ALTER TABLE YourTable ADD CONSTRAINT UQ_UserId_ContactID UNIQUE(UserId, ContactID)