Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    45

    Question Unanswered: Stored proc calls another stored proc

    Hi all,

    I have a stored procedure "uspX" that calls another stored procedure "uspY" and I need to retrieve the return value from uspY and use it within uspX. Does anyone know the syntax for this?

    Thanks for your help!
    Cat

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Check the section on stored procedures in Books Online and read the section on Output variables.

    However, when returning a value for use in another block of SQL code, I prefer using user-defined functions over stored procedures.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jun 2005
    Posts
    45
    Hi Blindman,

    Thanks for your response, but I'm trying to retrieve the value without having to declare an output parameter. This procedure is also being called by the application and I'm trying to maintain a standard procedural interface. I can work around this using the output parameters, but I thought that there must be a way to retrieve a return value from a stored proc and I'm just not finding it. If I'm missing something in the docs, just let me know.

    Thanks for your help.
    Cat

  4. #4
    Join Date
    Jun 2005
    Posts
    45

    Talking

    Yea! I finally found what I needed.

    Thanks Blindman for making me persevere!
    Cat

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What solution did you come up with?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by blindman
    What solution did you come up with?
    You funny

    The message you have entered is too short. Please lengthen your message to at least 10 characters.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •