Skip to content

SQL Prompt

Welcome to the SQL Prompt feature suggestion list. Find out more information about SQL Prompt at http://www.red-gate.com/products/sql-development/sql-prompt/.

If you have any questions, need help or have found a bug in SQL Prompt, please visit the forums or our support portal.

SQL Prompt

Categories

JUMP TO ANOTHER FORUM

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback

80 results found

  1. Please add support for new SQL Functions such as DATE_BUCKET
    https://learn.microsoft.com/en-us/sql/t-sql/functions/date-bucket-transact-sql?view=sql-server-ver16

    Currently it get quoted which is quite inconvenient.

    declare @date datetime2 = '2020-04-30 21:21:21'
    Select 'Week',  DATE_BUCKET(WEEK, 1, @date)
    Union All
    Select 'Day',  DATE_BUCKET(DAY, 1, @date)
    Union All
    Select 'Hour',  DATE_BUCKET(HOUR, 1, @date)
    Union All
    Select 'Minutes',  DATE_BUCKET(MINUTE, 1, @date)
    Union All
    Select 'Seconds',  DATE_BUCKET(SECOND, 1, @date);
    

    becomes

    DECLARE @date DATETIME2 = '2020-04-30 21:21:21';
    SELECT   'Week', [DATE_BUCKET] ( [WEEK], 1, @date )
    UNION ALL
    SELECT   'Day', [DATE_BUCKET] ( [DAY], 1, @date )
    UNION ALL
    SELECT   'Hour', [DATE_BUCKET] ( [HOUR], 1, @date )
    UNION ALL
    SELECT   'Minutes', [DATE_BUCKET] ( [MINUTE],
    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  2. CREATE EXTERNAL TABLE and CREATE EXTERNAL DATA SOURCE syntax is not formatted nicely by SQL Prompt, it just puts the statements on one line.

    I've been told the developers are not going to take this on!!!!

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  3. The formatter is not recognizing the newish DateTrunc function in T-SQL, so formatting and intellisense do not work on SQL statements that include DateTrunc.

    4 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  4. Very often i have copied a list of items i want to query in an IN() statement from the database, for example:

    abc
    def
    ghi
    jkl

    and I want to format it like this:

    'abc'
    'def'
    'ghi'
    'jkl'

    or better yet:

    'abc'
    

    , 'def'
    , 'ghi'
    , 'jkl'

    Being able to highlight, right click, and select an option do do this, would be incredibly helpful.

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    completed  ·  3 comments  ·  Format SQL  ·  Admin →
  5. When using OPENJSON with the WITH clause, the formatter does not recognize the WITH clause as valid SQL. This should format but throws an error:

    DECLARE @JSONString NVARCHAR(MAX) SET @JSONString = N'{"Vendors":[{"VendorNumber":200,"VendorName":"Vendor1"},{"VendorNumber":201,"Vendo2"},{"VendorNumber":202,"VendorName":"Vendor3"}]}'

    SELECT VendorNumber ,
    VendorName
    FROM OPENJSON(@JSONString, '$.Vendors')
    WITH (VendorNumber INT '$.VendorNumber', VendorName VARCHAR(50) '$.VendorName')

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Admin →
  6. Any query where "AT TIME ZONE" is used (new feature in SS '16), the Format SQL throws and error.

    "SQL Prompt was unable to complete this operation. Problem areas have been highlighted"

    The highlighting start from "AT TIME ZONE..."

    Thank you

    14 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  7. In SQL Server 2016 it is now possible to calculate between timezones. Currently it gives me an error, when I want to format it. The syntax is also not allowed at the moment.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  8. SQL server 2016 SP1 introduced the "CREATE OR ALTER" PROCEDURE/VIEW - syntax, which would be very nice to have support for.

    https://support.microsoft.com/en-us/kb/3190548

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 7.3 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  9. I used to be able to format selected code, as long as it was valid. Now when I select code that is valid in a larger script that has invalid code it does not format the selected code at all. If the invalid code immediately precedes it it will suggest that there is an error in the first character of my selection when there is none, else it will just act like it did something but do nothing. This used to work and is a frustration now. This has been the case with both 7.3 betas and I believe at…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    completed  ·  1 comment  ·  Format SQL  ·  Admin →
  10. Looks like version 7.3 of SQLPrompt removes all blank lines after the query that it formats. Please change this back or make it optional to delete blank lines at the bottom of the query.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  11. SQLPrompt will take scientific notation, and alias it as 1[e1], 1[e2] and so on.

    1e1
    1e2
    1e3
    1e4
    1e5
    1e6
    1e7
    1e8
    1e9

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
    completed  ·  Aaron Law responded

    Hi Erik,

    Thanks for letting us know about this issue. It should now be fixed in the latest build of SQL Prompt (7.1.0.314)

  12. Sometimes, formatting makes a query less readable, e.g.

    insert table (col1, col2, col3, ....)
    values (1,2,3,...),
    (11,12,13,...),
    ...

    Formatting will put the values on multiple lines if there are enough of them. It's easier to see the data when they are on one line. So how about:

    --#region [optional description] #SQLPromptIgnore
    --anything in here doesn't get formatted
    --#endregion [optional description]

    Not sure what would be best for '#SQLPromptIgnore'

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Format SQL  ·  Admin →
  13. I love to have the options so that the first line of a stored proc is just the name i.e. create proc spName and the @parms varchar(20) and following would be on additional lines
    So for example

    create proc spName
    @Parm1 int
    ,@Parm2 int

    thanks
    Shannon

    4 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 8 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  14. I want to switch between TEAM and PERSONAL styles for Format SQL. It currently takes 8 mouse clicks to achieve this. Could you add a style lookup on the context menu or Red Gate tools menu and apply the style to the current document automatically as soon as it is selected.

    I want my team to be able to work in their personal SQL format, but always save in the TEAM format.

    9 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Format SQL  ·  Admin →
  15. When you have a nested inner join to an outer join, such as:

    SELECT a., b., c.*
    FROM
    A a
    LEFT JOIN B b
    INNER JOIN C c on b.bid = c.bid
    ON a.aid = b.aid

    It should allow an option to indent the nested join further to show that it is nested

    5 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Admin →
  16. CREATE FUNCTION MyFunc()
    RETURNS INT
    AS
    BEGIN
    ----IF 1=1
    --------BEGIN
    ------------<some code>
    --------END
    END
    END

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Admin →
    completed  ·  Aaron Law responded

    This should already be an option in SQL Prompt under Format→Schema statements→Indent contents.

  17. Opening over 2500 code objects to set a baseline format, required by a large customer, is a daunting manual task.

    Many of Red Gate's tools provide command-line functionality.

    Please add it to Prompt so we can bulk (re)format SPs, UDFs, Triggers. Integration into the commit-path (we use SVN) would be ideal for standardized check-ins (Commits).

    Can't recall whether a style is exportable... (License key awaited at new employer) Should be able to point to UNC location for the style to use.

    109 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    28 comments  ·  Format SQL  ·  Admin →
  18. I think I 've found a bug...
    If you Format this SQL

         DECLARE @Translations TABLE
            (
              [FundTypeId] INT NOT NULL ,
              [ColumnName] NVARCHAR(128) NULL ,
              [ColumnValue] NVARCHAR(256) NULL ,
              [InsertedAt] DATETIME NULL ,
              [InsertedBy] NVARCHAR(256) NULL ,
              [LastUpdatedAt] DATETIME NULL ,
              [LastUpdatedBy] NVARCHAR(256) NULL ,
              PRIMARY KEY ( [FundTypeId] )
            );
    
         SELECT *
         FROM   ( SELECT    [pt].[FundTypeId] ,
                            [pt].[FundType] ,
                            [pt].[Comment] ,
                            [pt].[InsertedAt] ,
                            [pt].[InsertedBy] ,
                            [pt].[LastUpdatedAt] ,
                            [pt].[LastUpdatedBy]
                  FROM      @Translations AS [tmp] PIVOT ( MAX([ColumnValue]) FOR [tmp].[ColumnName] IN ( [FundType], [Comment] ) ) AS [pt]
                ) AS [tmp];
    

    ... it will break the code as the MAX function of…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Admin →
  19. Place semi-colon on new line.

    I frequently format my statements as I'm developing them, but multiple times now I've started to add an Order By or some other clause after the auto-inserted semi-colon. I would like to see an option to place the semicolon on the line following the sql statement rather than directly after. This would enable me to start typing at the start of the next line without having to check if a semicolon had been added to the preceding line.

    Example:
    Select * From Table
    Where A = 1; -- Semicolon added by formatting
    Order By A

    9 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Admin →
  20. Please provide the option to format IF statements as follows, based on the format settings sample.

    IF @productType IN ('a', 'b', 'd', 'g', 'i', 'O', 'Q', 'X', 'Z') BEGIN

    ----IF @cost <= @compareprice BEGIN

    --------PRINT 'Less than $' + CAST(@compareprice AS varchar(20))

    ----END ELSE BEGIN

    --------PRINT 'Exceeds $' + CAST(@compareprice AS varchar(20))

    ----END

    END

    3 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Admin →
← Previous 1 3 4
  • Don't see your idea?