Stored Procs in Stored Procs

  • hi i am just wondering if u can use a stored proc(to have a group of values returned) in a stored proc or an sql statement and if so how to go about doin it thanks in advance

    Tim

  • I hope I am reading your question right.  You want to execute a stored procedure with output value inside another stored procedure ?

    CREATE PROCEDURE procA

    DECLARE @percent INT

    EXEC procb '1', 'A', @pc = @percent OUTPUT

    SELECT @percent

     

  • Unless they are set based procs... "Death by SQL"... the idea of code reuse to process single records will absolutely kill performance and make more maintanence nightmares than you can shake a stick at.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Have you thought of using functions in your stored procedures ? I've done this before with no apparent performance hit, and it makes debugging easier.

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

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