SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Formatting SELECT statements

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Formatting SELECT statements
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Formatting SELECT statements Reply with quote
How can I have my SELECT DISTINCT statements to be formatted like the one below?
Code:

SELECT DISTINCT
   s.name
   ,s.[schema_id]
   ,s.principal_id
FROM
   sys.schemas AS s


With
Code:

SELECT
   ... AS ...
   ,... = ...
FROM
   ... AS ...
   ,...
   JOIN
   ...
      ON   ... = ...
      AND   ...
WHERE   ... = ...
   AND   ...
   OR   ...
GROUP BY
   ...
   ,...
HAVING
    ...
   ,...
ORDER BY
   ...
   ,...

the result is
Code:

SELECT
   DISTINCT
   s.name
   ,s.[schema_id]
   ,s.principal_id
FROM
   sys.schemas AS s


and this
Code:

SELECT DISTINCT
   ... AS ...
   ,... = ...
FROM
   ... AS ...
   ,...
   JOIN
   ...
      ON   ... = ...
      AND   ...
WHERE   ... = ...
   AND   ...
   OR   ...
GROUP BY
   ...
   ,...
HAVING
    ...
   ,...
ORDER BY
   ...
   ,...

does not format SELECT statements at all, regardless there is a DISTINCT or not.
Wed Jan 25, 2012 6:52 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I can reproduce the same result, but not sure how to workaround the DISTINCT keyword issue, still looking into this.
Wed Jan 25, 2012 11:35 am 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.