SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Find all Job Relationships with SSIS Config files


Find all Job Relationships with SSIS Config files

Author
Message
Ray Sotkiewicz
Ray Sotkiewicz
SSC Veteran
SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)

Group: General Forum Members
Points: 201 Visits: 271
Comments posted to this topic are about the item Find all Job Relationships with SSIS Config files
Nadrek
Nadrek
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1917 Visits: 2729
Very interesting.

You've got some odd unprintable characters in there - I replaced them with spaces, and then have the following initial comments:

Why give it a parent job name? I'd think looping through every job as if it were the parent job would also yield valuable information if you're looking for "every job that calls job X" or the more general "Every job any job calls", as opposed to your question of "every job that is called by job X"


substring(Command, (29), (Len(Command)-29 ) ) AS 'Child_Job_Name'


is specific to your particular system. You should instead find the arguments for sp_start_job, which may be either named or positional.


AND sjs.command LIKE 'EXEC msdb.dbo.sp_start_job%'


is again specific - try LIKE '%sp_start_job%'. There is also no provision to detect if someone has an sp_start_job call inside a stored procedure called by the agent job.


,Left(substring(sjs.Command, (CHARINDEX('/CONFIGFILE', sjs.Command) + 13), (CHARINDEX('dtsConfig"', sjs.Command) + 9) -(CHARINDEX('/CONFIGFILE', sjs.Command) + 13) ), 256) AS 'Config_File'


I know little about SSIS, but you might want to see if the offsets used are specific to your system as well.

For both offset based parse strings as well as the LIKE clause, I would recommend some mix of CHARINDEX, REVERSE, LEN, DATALENGTH, RTRIM, LTRIM, PATINDEX, etc. etc. to be more general - perhaps you'll find a job step of your own that has an extra space, a comment before the executing line, or some other interesting artifact.
Iwas Bornready
Iwas Bornready
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13958 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search