Robert Cannistraci
asked on
Function is Correct, but Returns Incorrect Value when Called by SP
A function returning a string does so correctly when calling it as stand-alone correctly returns:
EXEC EmployeeDietaryRestriction _SELECT_Di etPerEmpID 184
Returns: 'Gluten-Free,Vegetrian,Veg an,' < correct
However, when called in an SP it returns a incorrect value:
EXEC @DietaryRestriction = EmployeeDietaryRestriction _SELECT_Di etPerEmpID @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.
EXEC EmployeeDietaryRestriction
Returns: 'Gluten-Free,Vegetrian,Veg
However, when called in an SP it returns a incorrect value:
EXEC @DietaryRestriction = EmployeeDietaryRestriction
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.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER