Yes, that would be a concern, however, I alleviate this issue by using a scalar function to look it up 😉
CREATE FUNCTION [dbo].[fx_FetchSQLAgentJobID] (
@JobName char(250)
)
RETURNS uniqueidentifier AS
/*
----------------------------------------------------------------------------------------------------------------
Purpose:Returns the job_id for the @job_id parameter of the msdb.dbo.sp_start_job procedure
Department:DBA
Created For:
----------------------------------------------------------------------------------------------------------------
NOTES:Pass in 'DAILY - CA OpisPriceTable Job', Returns: 50E2E4DD-711C-49B9-B29F-D1977FB5C8E6
----------------------------------------------------------------------------------------------------------------
Created On:05/13/2011
Created By:MyDoggieJessie
----------------------------------------------------------------------------------------------------------------
select dbo.fx_FetchSQLAgentJobID('DAILY - CA OpisPriceTable Job)
*/
BEGIN
RETURN (
SELECT job_id from msdb.dbo.sysjobs WHERE name = @JobName
)
END
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience