• Lawrence-136504 (3/18/2010)


    Which versions have you tested this logic on? I'm getting below error.

    Msg 8114, Level 16, State 1, Procedure xp_sqlagent_enum_jobs, Line 1

    Error converting data type nvarchar to int.

    Lawrence:

    I have this code running on both SQL 2005 (SP3+CU6) and SQL 2008 (SP1+CU5) in production. Would you be able to paste the following line into the script so we can see what is being sent to that stored procedure?

    <snip>

    INSERT INTO @JobState

    EXEC [master].dbo.xp_sqlagent_enum_jobs @IsSysAdmin, @JobOwner, @JobID

    --Paste this line into your script

    PRINT 'EXEC [master].dbo.xp_sqlagent_enum_jobs ' + CAST(@IsSysAdmin AS VARCHAR(38)) + ', ''' + @JobOwner + ''', ''' + CAST(@JobID AS VARCHAR(36)) + ''''

    --Normalize VARCHAR string for time formatting

    </snip>

    Thank you!

    Mark