Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Find all Job Relationships with SSIS Config files Expand / Collapse
Posted Tuesday, March 15, 2011 10:12 PM


Group: General Forum Members
Last Login: Thursday, January 28, 2016 5:38 PM
Points: 165, Visits: 271
Comments posted to this topic are about the item Find all Job Relationships with SSIS Config files
Post #1078770
Posted Thursday, December 5, 2013 8:44 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, June 27, 2016 8:37 AM
Points: 912, Visits: 2,656
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.
Post #1520145
Posted Wednesday, April 27, 2016 1:53 PM


Group: General Forum Members
Last Login: Today @ 6:30 AM
Points: 7,892, Visits: 765
Thanks for the script.
Post #1781477
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse