• Great script but gives me an error.

    Msg 102, Level 15, State 1, Line 12

    Incorrect syntax near '?'.

    I pasted the whole query into my Notepad++ and there I could see what the problem was:

    SELECT SJ.name as job_name

    , SJ.enabled as is_job_enabled

    , SS.enabled as is_schedule_enabled

    /*, ISNULL(SJ.description, '') as job_desc*/

    , SS.name as schedule_name

    , CASE freq_type

    ????WHEN 1 THEN 'Occurs on ' + STUFF(RIGHT(active_start_date, 4), 3,0, '/') + '/' + LEFT(active_start_date, 4) + ' at '

    ????????+ REPLACE( RIGHT(CONVERT(varchar(30),

    So I got rid of the question marks, let SQL Refactor do the layout and it worked like a charm!

    Probably a problem related to my setup but just in case somebody else has the same problem I attached the script.

    Cheers :smooooth: