A function returning a string does so correctly when calling it as stand-alone correctly returns:
EXEC EmployeeDietaryRestriction_SELECT_DietPerEmpID 184
Returns: 'Gluten-Free,Vegetrian,Vegan,' < correct
However, when called in an SP it returns a incorrect value:
EXEC @DietaryRestriction = EmployeeDietaryRestriction_SELECT_DietPerEmpID @EmployeeID --184
It Returns: '0' which is incorrect. It looks like a result code.
Why doesn't it work called from an SP? What am I missing here? Thank you for any help.