Single Line comments move to the next line

JimFJimF Posts: 49 Bronze 3
edited April 25, 2016 5:29AM in SQL Prompt
I don't know if this is a bug, or if this is a feature request. This is not a new bug/feature--it's been around for a while, I'm just getting around to mentioning it.

If you paste in the following snip into a SSMS tab and run Format SQL, the single line comment will stay in place (as it should)
Use AdventureWorks
Go

Select  *
From    Person.Contact As c
Where   c.ContactID > 0 -- This comment will stay where it belongs after Format SQL is run.

But, as soon as you add more statements, then running Format SQL will cause the comment to go to the next line. Is there a way to make that STOP?

This code...
Use AdventureWorks
Go

Select  *
From    Person.Contact As c
Where   c.ContactID > 0 -- This comment WILL MOVE to the next line after Format SQL is run.

Select *
From Person.Address As a

Then becomes...
Use AdventureWorks
Go

Select  *
From    Person.Contact As c
Where   c.ContactID > 0
 -- This comment WILL MOVE to the next line after Format SQL is run.

Select  *
From    Person.Address As a

Thanks,
Jim

Comments

  • Ali DAli D Posts: 56 New member
    Hi

    Thanks for reporting this, unfortunately there’s no way to stop this behaviour with the current formatting in SQL Prompt. However, we are hard at work on adding a much more powerful formatting system which will give you much better control over this behaviour.

    When we release the new formatter we’ll announce it on the forums so keep an eye out for this.

    Thanks
    Ali
Sign In or Register to comment.