To me this is really the best use of a function.It may indeed server you well, for now.There are a number of articles at SSC which handle set based operations and try to explain the issues with hidden joins, row by row operations (rbar), ...I would prefer a view over a function, because it still points the problem solving dba by nature to join analysis and troubleshooting.A single function in your que