?
Solved

sp_start_job - manual vs scheduled

Posted on 2010-09-16
9
Medium Priority
?
719 Views
Last Modified: 2012-06-21
when you start a job manually, sometimes it works, but fails when scheduled- what could be the reasons for that? how does it look for permissions differently?

thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 3

Expert Comment

by:Willy Van den Houten
ID: 33692049
What do you see as a reason on the sheduled taks for not starting ?

Or do you see an Hexadecimal error code ?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 33692165
Any error messages when it is failing..

Are you sure the the job is started from the same login
0
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 600 total points
ID: 33692479
A job starting via sp_start_job or via a schedule has no difference.  It is not permissions related because sp_start_job calls the SQL Agent service to start the job.  It would be no different than if the schedule were telling it to run at that time.  You have something else going on.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 33693100
I'm fairly sure the job is run under different authority if you start it vs. scheduler starting it.

Specifically, if you schedule a job, and the job owner has sysadmin authority, I think the job runs under the SQL Server Agent account, *not* as the actual job owner.

If you start the job yourself, it runs as the job starter.  I think :-) .
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 33693365
I'll have to test that one out myself SP!
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33694220
i believe what Scott says is what i saw.. but i am not able to reproduce it right now.. will fail if run manually, and pass if  maybe it is a data issue that i faced..

SCott, I just tested what you said..

*if you schedule a job, and the job owner has sysadmin authority, I think the job runs under the SQL Server Agent account, *not* as the actual job owner.

this is right

*If you start the job yourself, it runs as the job starter.

what i found is, it still ran under the job owner and not job starter.
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 33695201
>> what i found is, it still ran under the job owner and not job starter.

Which is how I believed it would work.
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 1400 total points
ID: 33696798
>> what i found is, it still ran under the job owner and not job starter. <<

Yes, sorry, for sp_start_job that is probably right.

If you right-click on the job and start it, it should run as the person starting it.


Either way, that is still different from the way a scheduled job starts, if the job owner has sysadmin authority.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33762853
Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question