Referential integrity ... at least that's how its called I think.
Here is what I need help with please...
I have a USERS table with UserID , Name... etc
Also I have a bunch of other tables. All tables have AddedBy field that contains UserID from the USERS table indicating the user who added the record.
I need to set it up so that the user cannot be deleted from the USERS table if it's being used in any other tables in the AddedBy field. Also, I need to have some kind of constraint that will make sure that AddedBy contains values only from the USERS table.
Thank you in advance.
ps. Would be great to know how to set it up through the SQL Server 2005 Management Studio