This content has been marked as final. Show 2 replies
You cannot call a stored procedure from a SELECT statement.
If SP_ANOTHER_PROC is simply returning data, however, it should not be defined as a stored procedure. It should be defined as, most likely, two different stored functions (and/or one stored function that returns a composite type). You can call stored functions from a SELECT statement presuming they meet the other criteria (the function cannot modify the state of the database, for example, and it cannot have OUT parameters (though it must return a value)).