Calling two strored Procs inside a Stored Proc

  • hi,

    I have a Procedure which needs to 2 procs to be run before running it ,

    so can i run the 2 procs inside the proc and one important condition is that the resultsets of these 2 calling procs should not get displayed in the proc.

  • You can use the EXEC statement inside the calling proc and pass it the name of the proc(s) you need to run first one at a time.

    That should cover what you need.

    Depending on what the other procs do, the results shouldn't be displayed anyway but you'd need to check.

  • You might want to be a little more specific what you mean by

    should not get displayed

    ...

    If you run the "outer" sproc in SSMS, any result set being returned by the "inner sproc" will be visible in the result window.

    If you run a SQL agent job that calls the "outer" sproc, you'll just get a "finished" or "error" status (assuming you don't use RAISEERROR in your code...).



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

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