Home Forums SQL Server 7,2000 T-SQL TSQL error: 'Invalid length parameter passed to the substring function.' RE: TSQL error: 'Invalid length parameter passed to the substring function.'

  • So basically you just commented out the 2nd part of the join as follows:

    left outer join msdb.dbo.sysjobsteps js on j.job_id = js.job_id

    --and js.step_id = SUBSTRING( p.program_name, 72, LEN(p.program_name)-72 )

    However, it shows many invalid links between job & jobstep...

    compare the end of p.program_name ( job: .... step: #) with jobstep_id & you'll see.

    Also you could add this in the select statement to see:

    job_step_id = SUBSTRING( p.program_name, 72, LEN(p.program_name)-72 )