I had a quick look into the "An INSERT EXEC statement cannot be nested" error.
Yes this error does not stop the report from running but if you schedule a job that runs this procedure the scheduled job will report a failure. So the error needs to be removed.
I replaced this line in the original code:
INSERT #jobs_status EXEC msdb.dbo.sp_help_job
select sj.job_id, sj.name, sc.name as Category, sj.Enabled, sjs.last_run_outcome,
(select max(run_date) from sysjobhistory sjh where sjh.job_id = sj.job_id) as last_run_date
from sysjobs sj
join syscategories sc
on sj.category_id = sc.category_id
join msdb.dbo.sysjobservers sjs
on sjs.job_id = sj.job_id
This gets rid of the "An INSERT EXEC statement cannot be nested" error.
If there are any issues with the above code please let me know.
This is my first post so be kind:-D!!!