How can we help you today? How can we help you today?

Layout moves comments to new line.

I have the following snippet of code in a stored procedure (for breveity I have omitted the part of sql prior to the FROM clause):
    FROM
        dbo.Users u
        JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p /* @A1A */
            ON u.External_Person_Key = p.TechId /* @A1A */
when I choose to layout the sql I get the following:
     FROM
        dbo.Users u
        JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
            /* @A1A */ ON u.External_Person_Key = p.TechId /* @A1A */

These comments are change flags. They need to stay on the line they are placed on.
If I put the change flage in the first column like this:
     FROM
        dbo.Users u 
/* @A1A */JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
/* @A1A */  ON u.External_Person_Key = p.TechId 

I get:
     FROM
        dbo.Users u /* @A1A */
        JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
            /* @A1A */ ON u.External_Person_Key = p.TechId 

If I do this:
     FROM
        dbo.Users u 
        /* @A1A */ JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
            /* @A1A */ ON u.External_Person_Key = p.TechId 

I get:
     FROM
        dbo.Users u /* @A1A */
        JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
            /* @A1A */ ON u.External_Person_Key = p.TechId 

I would like to have the comments stay on the line they are keyed into.
Wrapping should be the only reason to adjust it. BTW, wrapping is set to 78 characters. But I get the same results if I turn wrapping off.
wsoranno
0

Comments

1 comment

  • wsoranno
    I have tried inline comments.
        FROM
            dbo.Users u
            JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p -- @A1A
                ON u.External_Person_Key = p.TechId -- @A1A 
    

    and I get the following:
        FROM
            dbo.Users u
            JOIN [$(csql2)].[$(UserAdmin)].dbo.Person AS p
                -- @A1A
                ON u.External_Person_Key = p.TechId -- @A1A 
    
    wsoranno
    0

Add comment

Please sign in to leave a comment.