1 2 3 4
| select S.server_id as nserveur, S.last_outcome_message as message,J.name, convert( datetime, convert( varchar , last_run_date ), 112) + convert( datetime, stuff( stuff( replicate ('0', 6 - len(convert(varchar, last_run_time )) ) + convert(varchar, last_run_time ),3, 0 , ':') , 6, 0 , ':' ) , 108) date_heure_derniere_execution, convert( varchar,stuff( stuff( replicate ('0', 6 - len (convert(varchar,last_run_duration )) ) + convert(varchar, last_run_duration ), 3, 0 , ':') , 6, 0 , ':' ) , 108) duree
from sysjobservers S
inner join sysjobs J on J.job_id = S.job_id"_&
where S.last_run_outcome <>1 |