capturing default return value of a sp

  • Guys,

    How to find out the default return value from a stored procedure. For Suppose if we created a sp without any parameters or with parameters sql server puts an extra parameter in the sp. That parameter returns an integer. This parameter tells whether the sp is run successfully or not.Can any one help me how to capture that extra parameter which is added by sql server to an sp.

    Thanks in advance.

    Who is wise? He that learns from everyone. Who is powerful? He that governs his passions. Who is rich? He that is content. Who is that? Nobody.:)

  • Naveen,

    Try this:

    DECLARE @Output smallint

    EXEC @Output = ProcName

    SELECT @Output

    If @Output value is 0 then SP is executed successfully. If it is less than ZERO then there is an error.

  • Thanks.

    Who is wise? He that learns from everyone. Who is powerful? He that governs his passions. Who is rich? He that is content. Who is that? Nobody.:)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply