9

I'd like to call another job immediately after first one has finished, or to be more precise is it possible to call an entire sql job via a job step. I'd like to avoid merging these jobs into 1 so I wonder if this solution is possible?

Amicable
  • 3,115
  • 3
  • 49
  • 77
ilija veselica
  • 9,414
  • 39
  • 93
  • 147

3 Answers3

5

Yes, you can execute a job by using this stored procedure. In your case, you can simply add a step to the end of your first job, to call the name of the job you want executed next.

EXEC msdb.dbo.sp_start_job N'Job Name';

See sp_start_job (Transact-SQL) for more information.

mservidio
  • 12,817
  • 9
  • 58
  • 84
1

create a T-SQl Step and use EXEC msdb.dbo.sp_start_job N'YourJob';

Diego
  • 34,802
  • 21
  • 91
  • 134
-1

Call the Jobs in the order you wish from a stored procedure.

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130