SQL Server Performance

Error checking in stored procedures

Discussion in 'General Developer Questions' started by benwilson, Apr 12, 2005.

  1. benwilson New Member

    Hi All,
    I have a stored procedure (SP1) that calls another stored proc (SP2). In SP1, i call SP2 like this:

    EXEC @ReturnValue = SP2 var1, var2, var3

    if an error occurs in SP2, it returns the value of the error code in the return statement into @ReturnValue. After the procedure call, do i need to check just @ReturnValue to see if an error occured, or do i need to check @@Error too??

    Thanks
    Ben
  2. derrickleggett New Member

    Check the return value.

    MeanOldDBA
    derrickleggett@hotmail.com

    When life gives you a lemon, fire the DBA.
  3. benwilson New Member

  4. derrickleggett New Member

    I've gotten a lot of help from my EMC friends over in Australia. [<img src='/community/emoticons/emotion-1.gif' alt=':)' />] Unlike the support from some other countries I get hooked up with sometimes, the Australians usually get right to the point. Of course, that's usually because they want to get out of work, so they can have a cold beer and enjoy the sun. <br /><br />This has absolutely nothing to do with this post. lol<br /><br />MeanOldDBA<br />derrickleggett@hotmail.com<br /><br />When life gives you a lemon, fire the DBA.
  5. benwilson New Member

    ok, at the risk of looking like an idiot, i have to ask, what is EMC?

    And yes, we Australians do generally get to the point- it is easier than dancing around an issue, and does increase beer and sunshine time...although it is coming into winter...
  6. derrickleggett New Member

    EMC is a storage company. I deal a lot with their SAN equipment. A lot of their off hours support is in Australia.

    MeanOldDBA
    derrickleggett@hotmail.com

    When life gives you a lemon, fire the DBA.

Share This Page