SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Code Formatting Anomaly

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Code Formatting Anomaly
Author Message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Code Formatting Anomaly Reply with quote
I'm not sure if there are options to set certain attributes, but it seems that the "/" operator always triggers a new line. For example:

SELECT pl.LoanID
,dlt.CommitmentAmount
,pl.TotalFacility
,DealExchangeRate = ISNULL(pa.DealExchangeRate ,1)
,[Sector] = [pref].[Sector]
,[Sector_SubtotalClause] = [pref].[Sector]
,[Borrower] = pl.Borrower
,[Borrower_SubtotalClause] = pl.Borrower
,[Responsible Group] = [pref].[Responsible Group]
,[Responsible Group_SubtotalClause] = [pref].[Responsible Group]
,[Deal_Amount_MM] = pl.TotalFacility
/
1000000

I don't want the "divided by 1000000" on the next 2 lines.

Also, is there a way to have the aliases of table joins to be on the same line as the table name. For example, Id' rather have:

FROM vwPrimaryLoan
pl
INNER JOIN PrimaryArranger
pa
ON pl.LoanID = pa.LoanID
INNER JOIN RecordStatus
rs
ON pl.RecordStatusID = rs.RecordStatusID

be:

FROM vwPrimaryLoan pl
INNER JOIN PrimaryArranger pa
ON pl.LoanID = pa.LoanID
INNER JOIN RecordStatus rs
ON pl.RecordStatusID = rs.RecordStatusID
Mon Sep 20, 2010 3:18 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
There is something wrong with your code formatting settings. The formatted code seem to be completely screwed. I don't know if that is a result of malformed line breaks, a result of HTML display and text wrapping, or something else. Here is my screenshot of what it should look like after formatting, I copied your text into SSMS, removed a few lines and formatted it using Ctrl+F11


Mon Sep 20, 2010 7:21 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Forgot to mention that I used default formatting rules and settings
Mon Sep 20, 2010 7:22 pm View user's profile Send private message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Reply with quote
Well, I'd agree that my formatted code is "completely screwed". The question is how to fix it. I reset all my preferences to their defaults and I'm still having the same issue. I attached my screenshot below.

Tue Sep 21, 2010 11:54 am View user's profile Send private message
seth.rothman



Joined: 29 Jan 2008
Posts: 54
Country: United States

Post Reply with quote
Any thoughts on what I can try?
Wed Sep 22, 2010 2:31 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
You will need to remove extra line breaks manually. It is in code formatter logic not to move lines within a SQL statement because it is assumed that any manually entered line breaks are entered on purpose and that is what user actually wants.

In other words, please try formatting the original code not what you've got after bad formatting.

In case you'd like to use some formatting rules which aren't in the predefined set of options, please provide an example of what you want to format and the desired result.
Wed Sep 22, 2010 10:03 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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
Design by Freestyle XL / Flowers Online.