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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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