Layout moves comments to new line.

wsorannowsoranno Posts: 65
edited June 24, 2009 10:26AM in SQL Prompt Previous Versions
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.
Thanks
Bill Soranno
MCP, MCTS, MCITP DBA
Database Administrator
Winona State University
Maxwell 143
wsoranno@winona.edu

"Quality, like Success, is a Journey, not a Destination" - William Soranno '92

Comments

  • 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 
    
    Thanks
    Bill Soranno
    MCP, MCTS, MCITP DBA
    Database Administrator
    Winona State University
    Maxwell 143
    wsoranno@winona.edu

    "Quality, like Success, is a Journey, not a Destination" - William Soranno '92
Sign In or Register to comment.