• I use nested stored procedures for the same reasons.

    I quite often have

     
    
    IF .....
    INSERT #Tbl (Fields)
    EXEC usp_SelectProc1 @Arg1, Arg2...Argn
    ELSE
    INSERT #Tbl (Fields)
    EXEC usp_SelectProc2 @Arg1, Arg2...Argn

    type routines.

    The problem I have is that sometimes I want the usp_SelectProc stored procedures to use the INSERT/Exec method but you cannot nest this sort of functionality.

    The comments I would make are that if you are going to nest stored procedures

    • You need good documentation/comments otherwise the dependencies can be hard to keep track of.
    • Always use field lists in your INSERT statements just incase the exec usp_SelectProc is altered to returb additional fields.