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. Formatting a section (selected code block) with CTRL+K, CTRL+Y). This would allow me to highlight a section of a proc and format it to my liking and leave the (abomination) of the proc body untouched.

    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

    completed  ·  3 comments  ·  Format SQL  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  2. Can not use SQL prompt to layout XML data type functions, for example this statement:

    SELECT(SELECT 1 Col
    FOR XML PATH(''), TYPE).value('.', 'VARCHAR(MAX)')

    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

    completed  ·  1 comment  ·  Format SQL  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  3. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  5. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  6. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  7. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  8. Have a function which is the opposite to 'Format SQL' so you can select a section of text and have all the Line Breaks and padding taken out. Currently I use HTML Shrinker Pro to do this, but it would be nice to select a block and one line it eg..
    @DateAppointed = CASE WHEN LEN(DateAppointed)> 1 THEN DateAppointed ELSE @Unknown END ,

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  9. SELECT Number1
    ,Number2
    ,Number3
    FROM table r
    JOIN table2 tf
    ON r.column = tf.column
    AND r.column = 0
    WHERE column = 0
    AND column1 = 2

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    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

  10. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  11. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    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

  12. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  13. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  14. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    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)

  15. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    completed  ·  Aaron Law responded

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

  16. 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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  17. ;
    RECEIVE TOP(1)
    @h = conversationhandle,
    @t = message
    typename,
    @b = message
    body
    FROM SimpleQueueTarget

    From the Service Broker Workbench on Simple Talk.

    It only moves the semicolon to a separate line. No errors. Ignores "comma at start".

    And, yes, the @'s above probably start in column 1, when they're actually in col 5.

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    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

  18. When formatting a case statement I want the case keyword to show in uppercase just like the when and end keywords. Now initially it uppercases CASE but when running SQL format it turns it to lowercase (bug?) See example below of the current format behaviour.

    SELECT case WHEN 1 = 1 THEN 1
    ELSE 0
    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

    0 comments  ·  Format SQL  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  19. The SQL Prompt formatter incorrectly tries to capitalize (whether automatically while I type or using the formatter) system functions that are missing a database prefix. For example, SQL Prompt doesn't try to capitalize:

    sys.fn_listextendedproperty

    but it WILL capitalize

    fn_listextendedproperty

    as soon as I hit space, regardless of the CASE setting in SQL Prompt's options. Obvious, a capitalized FN_LISTEXTENDEDPROPERTY does not work: the function is case-sensitive.

    There does not appear to be a way around this, not even by setting Format -> Styles -> Case -> Buit-in functions to "Leave as is". That only resolves the problem for the manual formatter:…

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    completed  ·  Aaron Law responded

    This is fixed in the latest build of Prompt, if you’re still having problems please let me know.

  20. Case formatting to allow option of capitalising initial letter only - e.g. Select, not SELECT or select.

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    completed  ·  Aaron Law responded

    The latest version of Prompt has the casing option UpperCamelCase which will case SELECT as Select.

1 2 4 Next →
  • Don't see your idea?