August 15, 2016 at 5:16 am
Hi,
Unfortunately i delete my sql job.but right now i would like to restore it.
So how can i restore my deleted sql job any one can help me
Thank you.;-)
August 15, 2016 at 5:25 am
If you have a backup of msdb, you can restore it in a development box and try scripting out the job.
August 15, 2016 at 5:43 am
Could you please expalin...
Back of database or msdb ?
August 15, 2016 at 5:48 am
The agent jobs and schedules are stored in msdb database. So if you can restore the msdb, you can get the job back.
August 15, 2016 at 5:53 am
No i dont have any back....
So what will be the next way to restore becuase i can see my deleted job through the following query;
select * from msdb.dbo.sysjobhistory order by instance_id desc
But i dont know how to restore it
August 15, 2016 at 6:00 am
If you don't have a backup, and you didn't have the job scripted out, then I'm afraid you've lost it. The sysjobhistory entries will only show that the job existed and when it ran, but it won't help with the definition of the job.
John
August 15, 2016 at 6:32 am
If you don't have any backups, then you've got a much bigger potential problem on your hands than a lost job. You should define a backup strategy and implement it as soon as you can. What if this had been a production database?
August 15, 2016 at 6:47 am
I'll also add that the idea of source control for jobs and all other code on your server should become a concern... right after you get your backups setup so this doesn't happen again.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply