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

Provides intelligent code completion for SQL Server editors.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Paul Stephenson, Michelle Taylor, Mike Upton, justin.caldicott, Aaron Law

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

Postby rgelb » Wed Feb 13, 2013 7:59 pm

I have the following code:

Code: Select all
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:

Code: Select all
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?
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby eddie davis » Wed Feb 20, 2013 2:03 pm

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
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Re:

Postby rgelb » Wed Feb 20, 2013 6:06 pm

eddie davis wrote:
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?
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby eddie davis » Mon Feb 25, 2013 2:58 pm

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
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 942
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Re:

Postby rgelb » Mon Feb 25, 2013 8:25 pm

eddie davis wrote: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.
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby andy.campbell.smith » Tue Mar 12, 2013 8:53 pm

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
andy.campbell.smith
 
Posts: 173
Joined: Thu Oct 20, 2011 11:19 am
Location: Red Gate Software


Return to SQL Prompt 5

Who is online

Users browsing this forum: No registered users and 0 guests