• The color coding is actually correct. The first [ character starts a table name that only ends at the final ], so everything in between them is part of the table name. Black is the default color used for (a.o.) table names.

    Please read the rest of the discussion for a more comprehensive explanation (and for many people agreeing with our dislike of the question)

    Yes, the color is correct, but I didn't have a chance to copy the script, so I had to type it. I missed ] in the line with 'while' because you don't expect developers to create tables with such weird names and thought it was typo or something. but even if I didn't miss it and executed the statement, I would see that author just wanted to create a table with such weird name. My point is that if you have your app generating these kind of statements and you try to understand what actually is wrong (yes, author wanted to look us for some errors in the script as if it's supposed actually run infinite loop or begin transaction), anyway you copy it from profiler to studio, see 'BEGIN' and 'INSERT' in black and just then you look for syntax issues.

    As I understand the point of this question is to make us develop skills in typing scripts from the image and don't make errors, right? I failed. Am I a bad SQL developer after that?