• And be warned that such a constraint doesn't work properly. If, for example, you put a constraint using a scalar udf like that on the TOOL_SET table, it only gets checked when the TOOL_SET is changed. If it was checking existence of rows in the other three tables, it would not prevent those other three tables having the rows changed in such a way as to make a row in TOOL_SET not satisfy the constraint.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass