• MattW2010 (7/9/2010)


    I think this script will be extremely useful, but are you sure it works? I have AdventureWorks running on a SQL 2008 box, and I copied and pasted the code from the site, which erred out. I'm not really sure what is wrong with the code. The first error line is pointing to this line -

    ??+ 'SELECT /* ' + CONVERT(VARCHAR, Getdate(), 100) + ' */' + CHAR(10).

    Am I doing something wrong? Can you offer any assistance?

    Msg 102, Level 15, State 1, Line 130

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 133

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 153

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 159

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 208

    Incorrect syntax near 'END'.

    When copying/pasting from the web page, I had to remove the leading indentation. It's the white space that is causing these errors.