title: Adding a WHERE clause to a Foreign Key
body: <p>I have a table in my database (TableA) that has a column (TableA.Column1) that only allows values from certain rows of another table (TableB.Column2).  This is very similar to a normal foreign key relation except for the fact that only certain rows from TableB.Column2 are allowed.  For example, I may only allow rows from TableB.Column2 where TableB.Column3 > 100;</p>
  
  <p>Is there a way to express this type of referential integrity in a database?  I've tried adding a where clause to a foreign key and I've tried adding a subquery to a Check constraint.  I've not gotten either to work.</p>
  
  <p>Does anyone have any advice?</p>