Solved

sp_start_job - manual vs scheduled

Posted on 2010-09-16
9
715 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 150 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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 350 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

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.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

726 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