What are the challenges you face when working across database platforms? Take the survey
Options

Aliases in Brackets

michaelfriedmichaelfried Posts: 25
edited August 19, 2009 5:29AM in SQL Prompt Previous Versions
Is there a way to turn off Aliases in SELECTs and JOINs from automatically having Brackets around them when SQL Prompt auto-inserts the subclause?

For Example:
SELECT *
FROM    [dbo].[MyTable] mt

when you use the Tab button to expand the column list to all columns you get this:
SELECT  [mt].[Column1],
             [mt].[Column2],
             [mt].[Column3]
FROM    [dbo].[MyTable] mt

instead of this:
SELECT  mt.[Column1],
             mt.[Column2],
             mt.[Column3]
FROM    [dbo].[MyTable] mt

SQL Prompt 3.9 did not put brackets around the Aliases in the SELECTs and JOINs.

Mike

Comments

  • Options
    Anu DAnu D Posts: 876 Silver 3
    Thanks for your post.

    I am trying to replicate the issue.

    But it is working fine for me.

    Could you kindly check the detailed version of SQL Prompt you are using?
    You can know the detailed version of SQL Prompt by navigating to SQL Prompt 4 --> About SQL Prompt and version number is displayed on bottom right (just above Close button.)?

    And also if you could let us know the version of Management studio will be of great help.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
  • Options
    The SQL Prompt 4 detailed version is 4.0.2.27.

    SQL Server Management Studio Version is 9.00.3042.00.

    Enter the following query in the msdb database in SSMS and then use the Tab key to expand the SELECT statement:
    SELECT	sai.*
    FROM	[dbo].[sqlagent_info] sai
    

    It used to (and should in my opinion) display as follows:
    SELECT	sai.[attribute],
            sai.[value]
    FROM	[dbo].[sqlagent_info] sai
    

    but instead appears with brackets around the aliases:
    SELECT	[sai].[attribute],
            [sai].[value]
    FROM	[dbo].[sqlagent_info] sai
    

    Mike
  • Options
    Anu DAnu D Posts: 876 Silver 3
    Many thanks for your explanation.

    I have added this issue as a feature request in our internal tracking system.

    For your reference its id is SP-2769.

    Sorry for any inconvenience caused by this issue.
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.