SP output is -1

  • when we get a store procedure output as -1 ?

  • Ron007 - Wednesday, May 31, 2017 9:37 AM

    when we get a store procedure output as -1 ?

    [/quote]

    Are you getting that output? How are you calling the procedure?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Actually one of my friend asked this question.

  • My best guess is that it means an error occurred.  By default, a stored proc will return 0 (as the return code).  So that's typically taken as meaning a "good" result.  Thus it became common to use a negative number -- either for the return code or even the result set -- to show a "bad" result.

    SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!

  • Pretty much what Scott just posted. So your friend should look at the definition of the stored procedure. That would tell them why the output is -1

    Sue

Viewing 5 posts - 1 through 4 (of 4 total)

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