When I format:

SELECT *
FROM bob --a table I have created

It expands to:
SELECT   [bob].[bobId], [bob].[value]
FROM     bob --a table I have created

With the horrible brackets (well, not horrible when you need them, but generally make the code hard to look at. It would be very nice to have an option not use the brackets unless necessary (like if the column name was [bob is your uncle] with spaces or special characters).


In addition, now the tablename is not quoted, but the alias is, which is kind of ugly.

At the very least the alias should be quoted, but I think you need to take direction from the object being aliased.

When using the qualify object names, it applies quoted identifiers to the tablename, but not the alias. This statement started out with no quotes, and I used the wildcard expansion too:
SELECT   [bob].[bobId], [bob].[value], [bob2].[bobId], [bob2].[value]
FROM     [dbo].[bob] --a table I have created
            join [dbo].[bob] as bob2
                on bob.bobId = bob2.bobId

That is obviously inconsistent.
drsql
0

Comments

1 comment

  • Andras B
    drsql wrote:
    When I format:

    SELECT *
    FROM bob --a table I have created

    It expands to:
    SELECT   [bob].[bobId], [bob].[value]
    FROM     bob --a table I have created
    

    With the horrible brackets (well, not horrible when you need them, but generally make the code hard to look at. It would be very nice to have an option not use the brackets unless necessary (like if the column name was [bob is your uncle] with spaces or special characters).


    In addition, now the tablename is not quoted, but the alias is, which is kind of ugly.

    At the very least the alias should be quoted, but I think you need to take direction from the object being aliased.

    When using the qualify object names, it applies quoted identifiers to the tablename, but not the alias. This statement started out with no quotes, and I used the wildcard expansion too:
    SELECT   [bob].[bobId], [bob].[value], [bob2].[bobId], [bob2].[value]
    FROM     [dbo].[bob] --a table I have created
                join [dbo].[bob] as bob2
                    on bob.bobId = bob2.bobId
    

    That is obviously inconsistent.


    Sorry for taking time to get back on this. These are valid issues, and we will consider them in later releases.

    Many thanks
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.