Red Gate forums :: View topic - Can "Format SQL" not throw JOIN conditions on the next line?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5
SQL Prompt 5 forum

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

Search in SQL Prompt 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
rgelb



Joined: 25 Sep 2008
Posts: 26

PostPosted: Wed Feb 13, 2013 7:59 pm    Post subject: Can "Format SQL" not throw JOIN conditions on the next line? Reply with quote

I have the following code:

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:

Code:

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?
Back to top
View user's profile Send private message
eddie davis



Joined: 14 Jun 2006
Posts: 923
Location: Red Gate Software

PostPosted: Wed Feb 20, 2013 2:03 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
rgelb



Joined: 25 Sep 2008
Posts: 26

PostPosted: Wed Feb 20, 2013 6:06 pm    Post subject: Re: Reply with quote

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?
Back to top
View user's profile Send private message
eddie davis



Joined: 14 Jun 2006
Posts: 923
Location: Red Gate Software

PostPosted: Mon Feb 25, 2013 2:58 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
rgelb



Joined: 25 Sep 2008
Posts: 26

PostPosted: Mon Feb 25, 2013 8:25 pm    Post subject: Re: Reply with quote

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.
Back to top
View user's profile Send private message
andy.campbell.smith



Joined: 20 Oct 2011
Posts: 173
Location: Red Gate Software

PostPosted: Tue Mar 12, 2013 8:53 pm    Post subject: Reply with quote

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/94413-sql-prompt-feature-suggestions

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group