What are the challenges you face when working across database platforms? Take the survey

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
    FROM myTable
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.)


  • Options
    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.

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