The reliability of sysdepends and other types of similar functions (sp_depends) is somewhat suspect due to several factors. I wouldn't necessarily rely on it for determining a parent/calling function. The...
Just a snippet; also I'm not a huge fan of dynamic SQL : you'll also want to only let your col_names get generated if the input belongs to a protected...