mikek 50666 (8/25/2016)
Thanks Gail, OK if this method will not work what is the correct way to do this?
This method is about the only way to do it, unless you can change the table design such that you can use normal foreign key references.
Also, if you're absolutely certain that the relevant information in the child tables won't be updated after a row in Tool_Set has been created, then the scalar function method is safe. Otherwise you'll need to put constraints/triggers on all of the child tables to prevent data changes that would invalidate a row in Tool_Set.
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