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. Multiple format options for insert statements

    Currently SQL Prompt only has one option for formatting insert statements which poses a problem for us with multi value set inserts.

    Ideally we'd be able to select a formatting for a single value set insert and another format for a multi value set insert.

    This would allow us to do something like this:

    -- Single Value Set Insert
    INSERT INTO TestTable (TestName,
    ~~~~TestValue,
    ~~~~TestDate)
    VALUES (N'Something',
    ~~~~140,
    ~~~~'1/1/2019')

    -- Multi Value Set Insert
    INSERT INTO TestTable (TestName, TestValue, TestDate)
    VALUES (N'Something', 140, '1/1/1900'),
    ~~~~(N'SomethingElse', 150, '1/2/1900'),
    ~~~~(N'SomethingElse2', 160, '1/2/2000')

    The issue for us is that we have need of…

    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  2. Format lists on a clause basis

    I would like to control the list behavior on a clause by clause basis so that I can separate the formatting on my DECLARE statements differently than lists within SELECT and INSERT statements. As it stands, these are conflicting changes. So, the only way to get each variable declared on a separate line is to also have every column in other statements on a separate line. I'd like to be able to do BOTH of these:

    DECLARE @GUID UNIQUEIDENTIFIER = NEWID(),
    @Char CHAR(1) = 'A',
    @Int INT = 1,
    @Datetime DATETIME = CURRENT_TIMESTAMP,
    @Decimal DECIMAL(18,10) = 1.0,
    @Date DATE =…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  3. Custom values for VALUES clause

    I write a LOT of unit tests, usually at the rate of 15:1 to 20:1 to my executing code. I have these standardized and templated to make them easier and more consistent to build. e.g. @GUID UNIQUEIDENTIFIER = NEWID(),
    @Char CHAR(1) = 'A',
    @Int INT = 1,
    @Datetime DATETIME = CURRENT_TIMESTAMP,
    @Decimal DECIMAL(18,10) = 1.0,
    @Date DATE = CURRENT_TIMESTAMP,
    @Time TIME = CURRENT_TIMESTAMP,
    @Bit BIT = 1,
    @Money MONEY = 1.00,
    @Binary VARBINARY(18) = 0x01,

    These go into my VALUES clause for INSERT statements, but I current have to do all of this manually, which takes a LOT of time…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  4. Automatically add DROP TABLE IF EXISTS for #temp tables

    It would be nice if SQL Prompt had a way to add in the code DROP TABLE IF EXISTS #table for temp tables. Ideally it would add the statement immediately before the table is created from a CREATE TABLE or SELECT INTO statement.

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  5. Add option to wrap lines when concatenating strings

    Sometimes I set a variable equal to many strings concatenated together using the "+" syntax. When I format with Regdate, there is no option to wrap lines in this case. Everything ends up on the same line as the SET, so the lines often get very wide and go off screen.
    It would be great if there was an option to wrap text if things got too wide horizontally.
    One solution would be a setting to format concatenated strings like this:
    SET @Variable = N'String1'
    + N'String2'
    + N'String3'

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  6. Closing parenthesis and content indention on APPLY/EXISTS not indenting

    It seems that the contents and closing parenthesis of EXISTS and APPLY clauses is not being indented as I would expect. So either i'm weird....or Format SQL is doing it wrong?

    I'm using (
    .....this parentheses style
    )

    What it's doing:

    SELECT *
    FROM tblA a
    WHERE 1 = 1
    .....AND EXISTS (
    .....SELECT *
    .....FROM tblB b
    .....WHERE b.Col1 = a.Col1
    ..........AND b.Col2 = a.Col2
    ..........AND b.Col3 = a.Col3
    )

    What I expect:

    SELECT *
    FROM tblA a
    WHERE 1 = 1
    .....AND EXISTS (
    ..........SELECT *
    ..........FROM tblB b
    ..........WHERE b.Col1 = a.Col1
    ...............AND b.Col2 = a.Col2
    ...............AND…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  7. Indent AND/OR in WHERE/GROUP BY/etc. differently than ON clause

    Support request #137199: Provide an option to indent AND/OR entries in a WHERE clause to line up indented, but leave AND/OR entries directly underneath ON clauses:

    SELECT
            t1.col5
            , t2.col6
    FROM
            table1 t1
            INNER JOIN table2 t2
                    ON t1.col1 = t2.col1
                    AND t1.col2 = t2.col2 -- AND is directly below ON clause
    WHERE
            t1.col3 = 'Test'
            AND t2.col4 = 5 -- AND is indented underneath WHERE

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  8. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  9. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  10. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  11. 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.

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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..

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  13. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

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

    Changing

    SELECT TOP 10...

    to

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

    7 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  15. 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

    3 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  16. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

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

    open source sql prompt's formatting module.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  18. 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

    4 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  19. 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…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
  20. 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…)
    Sign in with: Facebook Google
    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