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.

How can we improve SQL Prompt?

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. format Window functions

    SQL Prompt fails badly in formatting window functions. As these are present at least since SQL 2014, SQL Prompt should be able to interpret them and format them accordingly.

    Example:

    I would format the LAG() function as follows:

    SELECT
    myColumn AS realColumn
    ,LAG(myColumn, 1, 0)
    OVER (
    PARTITION BY someColumn
    ORDER BY anotherColumn) AS calculatedColumn

    Try this with SQL Prompt - it's result is not very nice...

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  2. format expressions like operator

    Would it be possible to treat the 'LIKE' operator the same as '=' in the Expressions\Operators settings so they are all aligned?

    select AddressID
    from Person.Address
    where ModifiedDate
    between dateadd(month, -6, getdate())
    and getdate()
    and City = 'Bothell'
    or left(PostalCode, 2) like 'CB%'
    or PostalCode = @prefix + @suffix

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  3. Make equals signs line up with tabs

    When I type code I like to line up all the equals (=) signs using tabs so that all the code to the right of the equals sign lines up nicely on my screen. I find this really useful for improving readability when using column aliases, in joins, and in update statements.
    I can't find an option in SQL Prompt to do this and it annoys me when I format my SQL and all the equals signs become ragged.

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  4. Lists formatting for Columns and Parameters should be treated separately

    The starting item in a List of Columns for a SELECT statement is fine to place on the same line as the SELECT, however, for EXEC <proc name that is probably longer> it looks odd to have the Parameters line up at the end. This should be a separate choice for EXEC Parameters. I chose the "commas before" style for most everything, but prefer the "default" layout for EXEC proc parameters.

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  5. Refactoring INSERT into MERGE

    Refactoring INSERT into UPDATE is definitely useful, but most of us are familiar with these. The complex MERGE statement is a mess, and a clean way to generate that would be fantastic!! Especially since you can figure out the primary keys, etc..

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  6. Formatting arithmetic - new lines (Apex has this)

    The only edge Apex has over SQL Prompt formatting, at least for my use, is being able to organize long equations. If I am using a large number of columns for an equation, I'd like to place each new column on a new line.

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  7. Top with parenthesis should be a formatting option

    Changing

    SELECT TOP 10...

    to

    SELECT TOP (10)... should be a formatting option.

    3 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  8. Align BETWEEN with comparison operators

    It's currently possible to align operations in WHERE which is great, but BETWEEN is not aligned.
    Example - currently:
    WHERE_ModifiedDate BETWEEN DATEADD(MONTH, -6, GETDATE()) AND GETDATE()
    AND City______________= 'Bothell'
    OR LEFT(PostalCode, 2)_= 'CB'
    OR PostalCode_________= @prefix + @suffix

    Expected:
    Example - currently:
    WHERE_ModifiedDate_____BETWEEN DATEADD(MONTH, -6, GETDATE()) AND GETDATE()
    AND City______________= 'Bothell'
    OR LEFT(PostalCode, 2)_= 'CB'
    OR PostalCode_________= @prefix + @suffix

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  9. Move the Options - Styles configuration to the individual Style definition page

    Options - Styles pane contains, for example, "Apply column alias style" and its drop-down. This does not belong as a universal style setting, among others.

    Please move it to the "Formatting Styles" configuration dialog.

    This is because many practitioners either do not know about the "alias = column" capability in T-SQL, or don't like it, or it's contrary to company standards. The ability to use this form, which IMO is more brain-friendly, ought to be on the Formatting page as it is, in fact, a significant style element.

    Thanks.

    3 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  10. open source sql prompt's formatting module.

    open source sql prompt's formatting module.

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  11. THEN expression on same line as keyword

    Current formatting is:

    CASE
    WHEN 1 = 1 THEN
    'Hello World'
    END

    I need the option to put the expression on the same line:

    CASE
    WHEN 1 = 1 THEN 'Hello World'
    END

    3 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  12. Comment in /* */

    Is it possible to add a hard return after the /* comment */ block so code doesn't keep formatting after the comment

    Currently:
    /* comment */ UPDATE User
    SET Modified = CAST('2018-12-20' AS datetime)
    WHERE id = 255454

    Suggestion
    /* comment */
    UPDATE USER
    SET Modified = CAST('2018-12-20' AS datetime)
    WHERE id = 255454

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  13. Add Support for Microsoft Analytics Platform System

    If a sql command is written with an APS specific statement (for example: "CREATE TABLE AS, or "OPTION (Label = 'Query Description')" ), then a script parsing error appears.

    8 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  14. Prefixes in function parameters

    SQL Prompt is removing prefixes from column names used as parameters in function-calls. For example, if you use Cross Apply to a system function:
    SELECT *
    FROM sys.tables AS T
    CROSS APPLY sys.fn_listextendedproperty('blah','schema',schema_name(T.schema_id), 'table', T.name, null, null)
    It removes "T." from schema_id and name in the parameters list. This means I have to add them back in if the column names are ambiguous. I don't see a setting for this, and have Prompt set to add prefixes to columns in the other clauses. So it'll add "T." to a column in the Select clause, and remove it from the same…

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  15. Trim white space

    Please add an option be added to SQL Prompt to trim all white space.

    Ideally, the following would be supported:
    - Ability to execute against a query window or block of selected code
    - Available as a stand-alone shortcut
    - Can include as part of a Format SQL style
    - Option to remove a) leading spaces, b) trailing spaces, c) both

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  16. Apply casing formatting as I type, but without the suggestions.

    Currently, SQL Prompt either allows you to apply casing all at once with the Apply Casing Options, or it does it as you type if Enable Suggestions is turned on.

    Please add a feature so that I can have casing applied as I type, but without the suggestions.

    3 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  17. Don't allow for aliases that match snippet acronyms

    What I sometimes run into, is that a table gets an alias (by SQL prompt), that matches an acronym for a snippet. Then, whenever I'm writing out my query, while calling the table by alias, snippet manager replaces the alias with the full snippet. Which can be annoying as Ctrl-Z doesn't work.

    My suggestion would be to check the snippet manager before assigning aliases and not have them overlap.
    Thanks.

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  18. Be able to add space between two right parentheses

    When I have two right parentheses next to each other like in a query like this (in the OPTION clause)
    SELECT Columns
    FROM TableA
    INNER JOIN TableB
    ON TableA.Key = TableB.Key
    OPTION( USE HINT( N'FORCE_DEFAULT_CARDINALITY_ESTIMATION' ) )

    There doesn't appear to be an option to have the space between the two right parentheses at the end. I have tried checking/unchecking quite a few boxes in the formatting style editor, and I don't think anything is controlling this. To me, the "add spaces around parentheses contents" option should put a space between the two right parentheses, but it doesn't.

    11 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  19. Vertical rivers - cobol style

    When writing SQL I don't think procedurally, which means I don't think about nested, indented "blocks" unless I'm actually using some procedural style SQL extensions like try/catch, if, case (which is a little procedural expression inside a set based statement), and so on.

    Because of this, I like to align various different "types of things" in a statement to create vertical rivers.

    So, for example, insert, update, select, from, join, where, group by, having, and order by are all aligned on the left. You might think of this as "column 1 - sql keywords".

    Then come column names, table names…

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  20. Aliases

    On SQL Prompt Aliases section I would like to have on custom aliases when I add a new a dropdown or a list view where I can pick object instead of me writing the object name. it would be even better if it has an option to show only object not already added with alias.

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1 3 4
  • Don't see your idea?

Feedback and Knowledge Base