SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
SQL Assistant, Align Assignments, Square Brackets

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
SQL Assistant, Align Assignments, Square Brackets
Author Message
anildas



Joined: 14 Nov 2007
Posts: 69
Country: United States

Post SQL Assistant, Align Assignments, Square Brackets Reply with quote


I have Align Aliases = Yes
It works, unless the attribute is enclosed by square brackets:

Without square brackets:
Code:

SELECT foo     AS Aa,
       bar     AS Ab,
       foobar  AS Ac
FROM   FooBar


With square brackets:
Code:

SELECT foo       AS Aa,
       [bar] AS     Ab,
       foobar    AS Ac
FROM   FooBar



Last edited by anildas on Tue Feb 14, 2012 6:20 pm; edited 1 time in total
Tue Feb 14, 2012 4:06 pm View user's profile Send private message
anildas



Joined: 14 Nov 2007
Posts: 69
Country: United States

Post Reply with quote
Related annoyance: Turning off Align Assignments does not seem to work, assignments still aligned:

Tue Feb 14, 2012 4:11 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
While delimited names seem to cause some misalignment, the query you have here is a common select. Assignments include at least one '=' by definition. But since it is formatted like this (regardless of square brackets being present or not)
Code:

DECLARE   @fileid       SMALLINT
       ,@groupid      SMALLINT
       ,@size         INT
       ,@maxsize      INT
       ,@growth       INT
       ,@status       INT
       ,@perf         INT
       ,@name         SYSNAME
       ,@filename     NVARCHAR(260)

SELECT
   @fileid = fileid
   ,@groupid = groupid
   ,@size = [size]
   ,@maxsize = [maxsize]
   ,@growth = growth
   ,@status = [status]
   ,@perf = perf
   ,@name = [name]
   ,@filename = [filename]
FROM
   dbo.sysfiles

I think it either does not work at all or I'm not meeting some requirements to have it work properly.
Tue Feb 14, 2012 6:09 pm View user's profile Send private message
anildas



Joined: 14 Nov 2007
Posts: 69
Country: United States

Post SQL Assistant, Align Aliases, Square Brackets Reply with quote
I should have looked further.
My issue is about Align Aliases

Turning it Off does solve my related annoyance.

The original issue remains.
Tue Feb 14, 2012 6:15 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Thank you for all your input. We will look into that.
Tue Feb 14, 2012 6:20 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
To be more weird, using "AS" keyword the alias is properly aligned (though "AS" is not) and omitting "AS" makes the alias results in alias not being aligned at all.
Tue Feb 14, 2012 6:22 pm View user's profile Send private message
anildas



Joined: 14 Nov 2007
Posts: 69
Country: United States

Post Reply with quote
When I remove the AS, even without the square brackets the formatting is funky. Note also how the FROM expands to extra spaces.

Without aliases:
Code:

SELECT foo,
       bar,
       foobar
FROM   FooBar


With aliases:
Code:

SELECT foo     Aa,
       bar     Ab,
       foobar Ac
FROM           FooBar

Tue Feb 14, 2012 6:27 pm View user's profile Send private message
anildas



Joined: 14 Nov 2007
Posts: 69
Country: United States

Post Reply with quote
I'm running SQL Assistant 6.1.35 Professional Edition inside SQL Server Management Studio 10.50.2789.0 under Win7(x64) 6.1.7600.
Tue Feb 14, 2012 6:31 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.