sp_add_jobschedule question

what should the @name parameter be set to in the sp_add_jobschedule ?
I understand @job_name is the nameof the job.
@name is the name of the scheduled job-a ren't they both the same?
how can i find the name of my scheduled job?
ams7503Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SjoerdVerweijCommented:
@Name is the name of the schedule. Jobs have names, steps have names, and schedules have names.

To see names for existing schedules for a job:

exec msdb..sp_help_jobschedule @job_name = 'insertyourjobnamehere'

Random question: why not use Enterprise Manager?

0
ams7503Author Commented:
i would like to use sp_help_jobschedule , to find out ststus of jobs being run.
0
ams7503Author Commented:
Thanks for the help. I tried the sp_help_jobschedule to get the schedule name.
When I use it as
EXEC msdb.dbo.sp_add_jobschedule @job_name ='TempPackage',
 @name = 'TestSchedule',
  @active_start_time=173500

I get the foll error:

Server: Msg 14261, Level 16, State 1, Procedure sp_add_jobschedule, Line 47
The specified @name ('TestSchedule') already exists.


How can i fix it?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

SjoerdVerweijCommented:
Ah. If you want the status, just use

Exec MSdb..sp_help_job @job_name = 'TempPackage'
0
ams7503Author Commented:
Sorry, I meant to also update the schedule of the job, hence need to know the schedule name.
However,
I get the foll error:

Server: Msg 14261, Level 16, State 1, Procedure sp_add_jobschedule, Line 47
The specified @name ('TestSchedule') already exists.

Since, I want to change the schedule for TestSchedule, run it on a different time, or day.

0
SjoerdVerweijCommented:
Ah... if you want to CHANGE the schedule, use sp_update_jobschedule instead (syntax is fairly similar... look in Books Online).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ams7503Author Commented:
thanks.
sp_update_jobschedule works fine.

does sp_help_job show the last_run_outcome of the latest run schedule,alone.
since the result set for each of the schedules does not indicate the status of the schedule.
however, the result set of the overall job indicates the last_run_outcome

Is there any sp which indicates the status for each job schedule
0
SjoerdVerweijCommented:
I don't think so. You might want to try jobhistory.
0
ams7503Author Commented:
ok thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.