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

176 results found

  1. One of the most tedious elements of writing T-SQL is handling of proper comparisons in the WHEN MATCHED AND ... THEN UPDATE clause of a MERGE statement.
    For example, to compare a single nullable target and destination column you should compare:

    SRC.column <> TGT.column
    OR (SRC.column IS NULL AND TGT.column IS NOT NULL)
    OR (SRC.column IS NOT NULL AND TGT.column IS NULL)

    I'm not sure on exactly how would be best to handle this but it would be great if SQL Prompt could somehow auto-populate these clauses. Or even better would be some way to generate an entire merge statement…

    6 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)
  2. Using the parentheses option "expanded, to statement" for DDL, I would expect a constraint to appear with the opening parenthesis under the start of the constraint (eg, the "f" in a foreign key constraint) as follows:

    MyColumn int not null
       foreign key references SomeTable
       (
          someColumn
       )
    

    But it actually appears at the end of the same line as the constraint, and the entire contents are indented from that position:

    MyColumn int not null
       foreign key references SomeTable(
                                          someColulmn
                                       )
    
    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  3. When typing SQL aliases are inserted automatically if configured. However when opening existing query from some other source it would be nice to execute an options to add missed aliases based on the same configured rules as with editing.

    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

    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. This is a Format SQL request; not for SQL Prompt, but rather for this website. I don't know how many hundreds of examples have been posted where the author spent quite a bit of time formatting an example, only to have the posted code totally bastardized. Have at least a <code> tag that would present the content within the tag in a fixed-width font and not remove leading spaces. I've seen some posts where the poor soul has tried 2-3 times to get their poin t across only to have the presented code rendered in a way that completely loses…

    16 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)
  5. Indent the clauses that may follow an alter table statement. They currently are on the same line or split but not indented.

    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

    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)
  6. The columns listed in the CTE are not formatted like the columns in the AS clause. On larger CTE's, the listed columns may be hundreds or characters long so we get
    with xx
    ( a, b, c, d, e, ...) AS
    (Select a,
    b,
    c,
    d,
    e,
    ...

    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)
  7. Whitespace: I picked up an indenting/alignment pattern from a Stack Overflow thread that solves an abundance of arguments: Please provide the option for using Tabs to indent the line, and then use spaces for alignments following the first character.

    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

    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)
  8. when I paste after "Copy as In clause", got contents like this:

    IN
    (
    1, --comma at behind
    2
    )

    I hope got this:

    IN
    (
    1
    ,2 --comma at before
    )

    please provide option, thanks.

    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

    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)
  9. SQL prompt currently removes the empty line at the bottom of a script, which then break rule SC002.

    Can format include a setting to add a blank line at the bottom of a script, and also autofix sc002 issues.

    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

    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)
  10. It would be nice to have the ability to mass import/export aliases.

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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  11. I use T4 to generate a significant amount of SQL code. It would be useful for purposes of readability especially, to be able to call the formatter from within a T4 build process.

    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)
  12. 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…

    10 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)
  13. Hi
    it is better to SQL prompt use only aliases define with user.

    need option in Aliases : Only For Custom Aliases

    Sorry For My Bad English

    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

    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. Add ability to add or remove square brackets without having to edit the settings for which direction you want it to go.

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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  15. Have auto alias base its output on the alias name instead of the name of the table it is pointing to.

    Example: Alias "Transaction" pointing to "TransactionTableWithComplexName" should be "t" and not "ttwcn".

    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)
  16. 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.

    11 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)
  17. Provide the option to enable automatic schema addition when necessary. And when there may be more than one candidate schema, provide a warning

    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

    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)
  18. New Parentheses Style - #6 but ends like #1
    Numbering starting at the top left as #1 and continuing to the right one as #5. With the next line starting as #6 and finishing on the right of line 2 as #9.
    In the global parentheses settings, Lets make a #10 option which works like #6 in all ways except the closing parentheses is aligned with the beginning parentheses like it does on #1. Actually looking at the graphic that shows on #1, this looks like what I want, the trailing parentheses is below the first one, but #1 has…

    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. My Teams would prefer this option:

    xxxxxxxxxxxxxx (
    xxxxxxx,
    xxxxxxx )

    Opening parenthesis on the first line, and closing parenthesis on the last line.

    Second and following lines indented one stop. This display seems to strip out the leading spaces.

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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  20. Add an option to add a space between a function call, such as COUNT(), and FROM so that we don't end up with code like SELECT COUNT()FROM table. That doesn't happen when I select "Add spaces around parentheses" in the global parentheses options. The only way I've been able to get SQL Prompt to preserve that space is to select "Add spaces around parentheses" in the Function calls options, but I don't want a space between the function name and opening parenthesis.

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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  • Don't see your idea?