This must be a bug in SQL Server Management Studio.
The GO
statement is not a real statement that SQL Server knows how to handle but a convention that editors, such as Management Studio and the command line client, uses to delimit big queries into smaller pieces.
These smaller pieces are then executed one by one in order.
As such, if the GO
command is actually sent to SQL Server to execute, it won't know how to handle it and thus gives you the error you got.
In Management Studio 2014, the syntax coloring is fine with the nested comments, but the presence of the apostrophe inside trips up the code that tries to delimit the query into smaller pieces.
As such I think the bug here is that the code that tries to split on the GO
statement does not in fact support nested comments and thus is tripped up by the presence of them. Basically it seems to think that the comment ends after the inner */
, which is wrong, and then the apostrophe is considered the start of a string that has no end that then encapsulates everything that follows, including the GO
command.
Thus everything after the apostrophe is sent to SQL Server. SQL Server does support nested comments so it will see the GO
command as a statement, which it doesn't support, and thus the error.
I have reported this using Microsoft Connect here: SQL Server 2014 Management Studio, when delimiting on GO command, doesn't handle nested comments.