Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Identify source for starting a job Expand / Collapse
Author
Message
Posted Friday, July 18, 2014 10:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 9, Visits: 65
I have an odd one. I have a SQL job that doesn't have a schedule and is being run each morning. It is a legacy system and I am trying to document the data flow process and I am having a hard time tracking down where/what is starting the job. I see which user executed the job:

SELECT message FROM sysjobhistory WHERE job_id = 'jobid' AND run_date > 'yesterday'

Which is useful, but I want to know what is starting the job. I am going to begin researching putting a trace up, but I wanted to see if anyone else had run across something like this and had some input or brilliant ideas.
Post #1594142
Posted Friday, July 18, 2014 12:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 3:33 PM
Points: 150, Visits: 283
Did you check the details of the completed job in the job history?

Example from my log....
The job succeeded.  The Job was invoked by User <RunAsUser>.  The last step to run was step 1 (Execute procedure).

It wouldn't show what host initialed the job, but it'll show the account that triggered the job which may help you identify it.

The best bet would be to initiate a trace during the time frame of when the job starts. You can use the job history to see approximately when it starts.



Post #1594200
Posted Friday, July 18, 2014 12:41 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
What do you mean by what started the job? Do you mean you want to know if someone is using a PoSH script or .NET application to start the job?

In that case I think you'd need to use a trace or xevent session to find that information, provided the application connection string actually provides an application name.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1594201
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse