How to execute jobs in parallel from while loop of sql server

  • Hi,

    How to execute a job and loop through it until you have 5 jobs running in parallel(same job name)

    Is it possible to run same job name 5 times at a time?

    Thanks in Advance.

    Cheer's

    Rajesh

    Cheer's
    Rajesh

  • rajeshpalo2003 78748 (8/20/2012)


    Hi,

    How to execute a job and loop through it until you have 5 jobs running in parallel(same job name)

    Is it possible to run same job name 5 times at a time?

    Thanks in Advance.

    Cheer's

    Rajesh

    SSIS packages do not contain while loops (except, possibly, within scripts) and do not have the concept of jobs either.

    Is this even an SSIS question? If so, can you be more careful with your terminology and try to clarify your question please?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks for your reply.

    My SSIS package is configured by job.so i want to execute that job through stored procedure and i am try to execute that job 5 times parallel with same name instance.

    SP Query eg:-

    --------------

    WHILE (@CntStart < @CntEnd)

    BEGIN

    WAITFOR DELAY '00:00:00.05'

    EXEC msdb.dbo.sp_start_job N'Dynamic_Mapping'

    SET @CntStart = @CntStart + 1

    END

    is it possible?

    Cheer's

    Rajesh

    Cheer's
    Rajesh

  • rajeshpalo2003 78748 (8/20/2012)


    Thanks for your reply.

    My SSIS package is configured by job.so i want to execute that job through stored procedure and i am try to execute that job 5 times parallel with same name instance.

    SP Query eg:-

    --------------

    WHILE (@CntStart < @CntEnd)

    BEGIN

    WAITFOR DELAY '00:00:00.05'

    EXEC msdb.dbo.sp_start_job N'Dynamic_Mapping'

    SET @CntStart = @CntStart + 1

    END

    is it possible?

    Cheer's

    Rajesh

    Not possible as far as I know. SQL Server jobs can have only one instance at a time.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Rajesh

    As far as I know, you can't have the same SQL Server job running more than once at any one time. If you are only ever going to need to run it five times at once, why not create five different jobs? Or, you could put all your job logic into an SSIS package and call that package as many times you like at once.

    John

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

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