SQL Server 2000 - select statement in stored procedure can break OUTPUT params
if a stored procedure calls another stored procedure,
and that stored procedure has a SELECT statement that returns records (i.e. it does not simply set variables)
then this can cause the first stored procedure, to NOT SET any OUTPUT variables
including the return value !
solution:
modify the 2nd stored procedure, so that if it must do a SELECT, then it should set into local variables, rather than generating result rows.
of course, you need to check if any other code is using the 2nd stored procedure before changing it.
if a stored procedure calls another stored procedure,
and that stored procedure has a SELECT statement that returns records (i.e. it does not simply set variables)
then this can cause the first stored procedure, to NOT SET any OUTPUT variables
including the return value !
solution:
modify the 2nd stored procedure, so that if it must do a SELECT, then it should set into local variables, rather than generating result rows.
of course, you need to check if any other code is using the 2nd stored procedure before changing it.
Comments
Post a Comment