Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Posts
    186

    Unanswered: call a stored procedure from within another procedure

    How do i call a proc within another? The following generates an error
    Code:
    CALL usp_myProc(@val1, @val2)
    The error I get is:
    Code:
    Incorrect syntax near 'CALL'.
    If I comment that line out, then it works fine.

    Any ideas??

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    try EXEC instead of call
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jan 2008
    Posts
    186
    Quote Originally Posted by Thrasymachus
    try EXEC instead of call
    Great, thanks! I tried that and am not getting any parsing errors.

    Hmmmm does SQL Server not support CALL? I would've thought that's ansi standard or something

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    dunno. I know call is a VBA and old school VB command.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by dbguyfh
    Hmmmm does SQL Server not support CALL? I would've thought that's ansi standard or something
    Yes, SQL Server does support CALL, only it spells it "EXEC" instead.
    If it's not practically useful, then it's practically useless.

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

Posting Permissions

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