Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I have embedded a start comment in a comment in this query and its Order By clause is ignored:

Select 1 As [F]
Union all
Select 2 As [F]
Order By [F] DESC


share|improve this question
up vote 1 down vote accepted

The real issue is that you don't get a syntax exception for not closing the second comment. Running the SQL as-is produces the following error in SSMS:

Msg 113, Level 15, State 1, Line 5
Missing end comment mark '*/'.

Data Explorer is currently removing comments from your query prior to execution, and doesn't handle cases like this appropriately. I'll see what can be done about cases like this; it might just be better if Data Explorer doesn't try to do what it's doing now so errors like this would be thrown by SQL Server.

For right now though, I took care of this specific case.

share|improve this answer
Either this change never went live, or something is stopping the added error to occur. – Mark Hurd Aug 21 '12 at 16:15
Hasn't gone live yet. We're working on getting everything reviewed and pushed out ASAP (lots of changes in the pipe), sorry for the delay. – Tim Stone Aug 21 '12 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .