|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
anildas
Joined: 14 Nov 2007 Posts: 69 Country: United States |
|
SQL Assistant, Align Assignments, Square Brackets |
|
I have Align Aliases = Yes
It works, unless the attribute is enclosed by square brackets:
Without square brackets:
|
|
SELECT foo AS Aa,
bar AS Ab,
foobar AS Ac
FROM FooBar
|
With square brackets:
|
|
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 |
|
|
anildas
Joined: 14 Nov 2007 Posts: 69 Country: United States |
|
|
|
Related annoyance: Turning off Align Assignments does not seem to work, assignments still aligned:
|
|
Tue Feb 14, 2012 4:11 pm |
|
|
gemisigo
Joined: 11 Mar 2010 Posts: 2141
|
|
|
|
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)
|
|
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 |
|
|
anildas
Joined: 14 Nov 2007 Posts: 69 Country: United States |
|
SQL Assistant, Align Aliases, Square Brackets |
|
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 |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7907
|
|
|
|
Thank you for all your input. We will look into that.
|
|
Tue Feb 14, 2012 6:20 pm |
|
|
gemisigo
Joined: 11 Mar 2010 Posts: 2141
|
|
|
|
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 |
|
|
anildas
Joined: 14 Nov 2007 Posts: 69 Country: United States |
|
|
|
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:
|
|
SELECT foo,
bar,
foobar
FROM FooBar
|
With aliases:
|
|
SELECT foo Aa,
bar Ab,
foobar Ac
FROM FooBar
|
|
|
Tue Feb 14, 2012 6:27 pm |
|
|
anildas
Joined: 14 Nov 2007 Posts: 69 Country: United States |
|
|
|
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 |
|
|
|
|
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
|
|
|