What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

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

...yields:

 F
--
 1
 2
share|improve this question
add comment

1 Answer

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
add comment

You must log in to answer this question.

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