SqlServer Passing parameters within Nesting procedures I have these 2 procedures:

Create procedure jolly (@job_par varchar(100)='p%') as 
select * from emp where job like @job_par


create procedure test1 @proc_name varchar(30)
as exec @proc_name

if i execute like this 

exec test1 @proc_name= jolly


i get all the employees with job that begins with 'p', and it's ok.

But how can i call the procedure test1 to make me return all the employees with job='ACCOUNT'??

i tried like this but it gives me errors:

exec test1 @proc_name= jolly @job_par='ACCOUNT'


How can i pass the parameter for the second procedure?

Thank you.
You need to add the @job_par parameter to your calling procedure so that you can then pass that down the line. Using your example:

CREATE PROCEDURE jolly
    (
      @job_par VARCHAR(100) = 'p%'
    )
AS
    SELECT  *
    FROM    emp
    WHERE   job LIKE @job_par;
GO


CREATE PROCEDURE test1
    @proc_name VARCHAR(30) ,
    @job_par VARCHAR(100)
AS
    EXEC @proc_name @job_par;
GO


EXEC test1 @proc_name = 'jolly', @job_par = 'ACCOUNT';