Bug: Minor error formatting CTE

JonBruneJonBrune Posts: 14 Bronze 1
edited June 20, 2017 3:44PM in SQL Prompt
Not sure if this is the venue to report bugs, but I've run across an odd one.

Here's my query:
PRINT 'Why is comment moved?';

--Here is my comment
;WITH cteBar
AS (SELECT *
    FROM myTable
   )
SELECT *
FROM cteBar

That semicolon at the end of my print statement causes the format engine to add some lines between my comment and the CTE. Take away the semicolon and it works pretty good. (Although it still puts the semicolon before WITH on a separate line.)
Tagged:

Comments

  • Hi Jon,

    I've managed to reproduce your bug on my machine so we've logged a bug under reference SP-6429.

    Thanks for reporting! We'll let you know if we find a fix.

    Best,
    Michael
    Michael Clark
    Technical Lead, SQL Monitor
Sign In or Register to comment.