Can "Format SQL" not throw JOIN conditions on the next line?

rgelbrgelb Posts: 46 Bronze 4
edited March 12, 2013 3:53PM in SQL Prompt Previous Versions
I have the following code:
select p.x1, g.x2
from pTable p
join gTable g on p.EmpID = g.EmpID and p.SiteID = g.SiteID

Whenever I run Format SQL, it throws the second JOIN condition onto a new line:
select p.x1, g.x2
from pTable p
join gTable g on p.EmpID = g.EmpID 
                       and p.SiteID = g.SiteID

I messed with the Options but couldn't find a way to keep both conditions on the same line. Is it possible? If so, how?

Comments

  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Hi rgelb

    Does the advice in this help ARTICLE provide the answer to your question?

    The article explains how to create your custom style and use it in your code.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • rgelbrgelb Posts: 46 Bronze 4

    Does the advice in this help ARTICLE provide the answer to your question?

    Eddie, that's the point. I messed around with styles but I couldn't get it not to throw the second compare of the join onto a separate line.

    Could you do it?
  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Thank you for your reply.

    Can you please check to see if you have the following SQL Prompt Options enabled?

    SQL Prompt 5 ->Options ->Format ->Data statements ->New Lines (to the right) ->Place the following on a new line: ->Join condition and Align join condition with JOIN.

    If you have "Join condition" and "Align join condition with JOIN" options enabled, can you please disable these options and recheck to see if your join statement follows the style you have set?

    Many thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • rgelbrgelb Posts: 46 Bronze 4
    Can you please check to see if you have the following SQL Prompt Options enabled?

    SQL Prompt 5 ->Options ->Format ->Data statements ->New Lines (to the right) ->Place the following on a new line: ->Join condition and Align join condition with JOIN.

    If you have "Join condition" and "Align join condition with JOIN" options enabled, can you please disable these options and recheck to see if your join statement follows the style you have set?

    Those items were already disabled. Just for fun, I re-enabled them, then disabled them again - unfortunately no result.
  • Just following up on this - I've been playing around with SQL Prompt, and I can't find a way to configure SQL Prompt to not do this. I think your best bet right now is to log a feature request on our UserVoice forum here:

    http://redgate.uservoice.com/forums/944 ... uggestions

    If you wouldn't mind spending a few minutes voting on other features you'd like to see in the product we'd really appreciate it - we like UserVoice, because it lets us make sure the work we're doing is important and relevant to what our users are looking for. Sorry I can't help more right now!
    Andy Campbell Smith

    Red Gate Technical Support Engineer
Sign In or Register to comment.