var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Job Status
I need to know the current status for a job that i started.
I knew that sp_help_job give me all this information, but i have to do IF´s, so I have to set a variable with this result. I only need the columns last_run_outcome and current_execution_status.
How do I to get only this values from a Job_id ??
i Looked in almost all table from msdb to find these 2 columns and nothing ... :/
Anyone can helpme ?
The Answer Is :
exec sp_addlinkedserver @server = 'LocalServer',
@srvproduct = '',
@provider = 'SQLOLEDB',
@datasrc = @@servername
select last_run_outcome, current_execution_status from openquery(LocalServer, 'set fmtonly off; exec msdb.dbo.sp_help_job')
exec sp_dropserver 'LocalServer'
U donot need to drop the linked server, I did that to ensure that noerror will be shoed when adding linked servers