Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Returning full error details from SQL Server Agent jobs


Returning full error details from SQL Server Agent jobs

Author
Message
Adam Aspin
Adam Aspin
SSC-Enthusiastic
SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)SSC-Enthusiastic (183 reputation)

Group: General Forum Members
Points: 183 Visits: 1028
Hi David et al,

I am the one who owes apologies, I have no idea how the tagging corrupted the article presentation, and I am sorry that this happened.

I will attempt to rectify this when I can, but it might be a couple of days or so.

Thanks!

Adam
Carolyn Richardson
Carolyn Richardson
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1553 Visits: 3443
You can do a quick fix - though not normally recommended to amend system tables, but the following sets all agent jobs to log to table.

UPDATE [msdb].[dbo].[sysjobsteps]
SET flags = 15

Facts are stubborn things, but statistics are more pliable - Mark Twain
Carolyn
SQLServerSpecialists
Kyle Van Andel
Kyle Van Andel
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 202
If you happen to have a large number of jobs and want to change them all according to this topic; the script below should get the job done without having to manually click through each job/jobstep.

declare @Jobs table (jobId uniqueidentifier)
declare @Steps table (stepId int)
declare @jobId uniqueidentifier,
      @stepId int

insert into @Jobs select job_id from msdb.dbo.sysjobs

while exists(select 1 from @Jobs)
begin
   select top 1 @jobId = jobId from @Jobs
   delete from @Steps
   insert into @Steps select step_id from msdb.dbo.sysjobsteps where job_id = @jobId
   while exists(select 1 from @Steps)
   begin
      select top 1 @stepID = stepId from @Steps
      exec msdb.dbo.sp_update_jobstep @job_id=@jobId, @step_id=@stepId, @flags=8
      delete from @Steps where stepId = @stepId
   end
   delete from @Jobs where jobId=@jobId
end


saidbouzelha
saidbouzelha
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 2
I am on SS 2000, can't get step 6! Any help to debug a job that failed?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search