Check constraint over two columns
- by Rippo
I want to add a Check Constraint to a table for server 2005 but cannot work it out.
MemberId ClubId MeetingId
1 100 10
2 100 10
3 100 10
7 101 10 <-This would throw a check constraint
1 100 11
2 100 11
I do not want to have more than one ClubId for a single MeetingId
Basically a ClubId can only belong to a single MeetingId but can have more than one member assigned.
How do I achieve this?