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

173 results found

  1. Merge Command Formatting

    For MERGE commands there is no way to make the conditional requirements with 'ON' follow the same style as JOIN's ON. I noticed back on 5/17/2017 there was a closed 'Merge command formatting options' through the User Voice, stating that an experimental feature was available for SQL Prompt 7.4. What happened? In my 10.1.7.15015, within the formatting styles, there is no area for MERGE like there is for JOIN.

    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)
  2. Option (such as a check box) to omit active style formatting of comment lines between /* and */. Similar to SQL Prompt formatting off/on without the added code lines.

    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)
  3. When Place Begin - End statements on new line is selected it doesn't appear to work as part of an If statement. This makes the begin and end difficult to find

    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)
  4. Currently SQL Prompt inserts SQL full INSERT script or EXEC SP in multiline while it might be useful for INSERT statement, but most of the times I have to realign them into a single line. It would be good if we have the option to choose wheather to add statement in single line or multi line? and its more usefull if we have shortcut to switch the inserted statement between formats?

    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. I would like to expand upon suggestions others have made regarding adding custom formatting and analyzers.
    I have recently been trying to implement SQL Prompt for our team, and I have struggles with a lack of customization, opinionated options that don’t reflect our needs, and some bugs.
    What would have solved this issue for me would have been the ability to add custom formatters and custom analyzers.

    Custom Formatters
    Since SQL Prompt gets the position of tokens from IAlignmentProvider.FinalAlignmentForToken I suggest that the API couple simply be plumbed into this method, if a plugin is attached it would call the…

    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. When I am composing a script in Multi-Script, I'd like to have the editing settings available. Include variable/column name completion, keyword formatting, indention, etc..

    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. We have code littered with IIFs that we would like to convert to CASE. Logically this is straightforward, but achieving it swiftly is proving more difficult. A regex takes care of the simple ones, but the ugly ones with nested functions across multiple lines and all sorts are proving far more difficult.

    Would it be possible to add a feature to SQL Prompt to refactor IIFs into CASE statements? Thanks

    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)
  8. When collapsing CASE expressions shorter then XXX, the END has no space if there is a preceding parenthesis.

    Example1 = CASE t1.Col004 WHEN 1 THEN t1.Col006 END,
    Example1 = CASE t1.Col004 WHEN 1 THEN TRY_CONVERT(int, t1.Col006)END

    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)
  9. PERSIST_SAMPLE_PERCENT is a new feature in SQL Server 2016 SP1 CU4.

    SQL Prompt does not think this is a valid UPDATE STATISTICS statement:

    UPDATE STATISTICS dbo.MyTable(MyStat)
    WITH FULLSCAN, PERSIST_SAMPLE_PERCENT = ON;

    It is valid and the correct syntax. SQL Prompt should be updated to format this correctly.

    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. When saving/opening file automatically untabify it.

    (select all then edit|advanced|untabify selected lines)

    Some how, some way, despite telling everyone to set convert tabs to spaces we constantly get tabs in our SQL code. It would be really nice to just have it automatically convert to spaces so I can save a few clicks.

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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  11. Formatting a SQL batch which contains

    BACKUP DATABASE Databasename
    TO URL = N'URL'
    WITH CREDENTIAL = N'Credential'

    leads to

    BACKUP DATABASE Databasename
    TO URL = N'URL'
    WITH AS CREDENTIAL = N'Credential'

    the AS between with and credential is wrong.

    Please fix :-)

    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)
  12. When formatting SQL, it would be good to have the option to put the item following an AND/OR on a new line and align it, so instead of:

    WHERE
    OutgoingResults.LoadDateKey = 20191106
    AND OutgoingResults.FeedName = 'TestFeed'

    we have

    WHERE
    OutgoingResults.LoadDateKey = 20191106
    AND
    OutgoingResults.FeedName = 'TestFeed'

    12 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

    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)
  13. Hi there. Currently, SQL Prompt formats an invocation of a sproc like this:

    exec sproc @param1 = ?,
    @param2 = ?,
    @param3 = ?

    I'd like to be able to change this into:

    exec sproc
    @param1 = ?,
    @param2 = ?,
    @param3 = ?

    Thanks.

    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

    4 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. Some of us would like the option for formatting of table declarations to not only align [tabify] column names (indented one tab), but also columnize/tabify the data types and nullability so that table definitions are grid-like. Constraints per column are are far more variable and therefore require more of a free format or sometimes pushing them to subsequent lines, but at minimum, the ColumnName, DataType and Nullability should be optioned to columnize by default.

    When there are hundreds or thousands of tables in a db schema, I'm used to scanning table definitions, and having them organized grid-like saves my eyeballs…

    7 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)
  15. It would be nice to have an option to not but square brackets around aliases as it's our style to not do so. We find it makes the aliases unnecessarily long,since most of our aliases are 1 or 2 letters.

    For example

    SELECT
    T.[TableId],
    T.[Name]
    FROM
    [dbo].[MyTable] T

    vs

    SELECT
    [T].[TableId],
    [T].[Name]
    FROM
    [dbo].[MyTable] [T]

    Currently we have to go back and rename an alias to itself so that the square brackets go away.

    8 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)
  16. Feature to automatically add column alias with the name of the column.
    E.g.:

    SELECT Column1
    FROM Table1 AS t1

    changes to:

    SELECT Column1 AS Column1
    FROM Table1 AS t1

    If the name can not be found add a dummy-alias like Exp1

    8 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)
  17. I realize my title is very vague.

    Basically, I would like more control options over how styles are applied. Maybe I'm just really weird in how I format my SQL, but it seems like no matter how hard I try, I can never get the styles the way I want them.

    I realize that it's impossible to make it perfect. But the basic idea is to get the formatter to do what you would normally do the majority of the time.

    For example....the majority of the time, I prefer the following...

    For JOIN clauses, all join criteria is in the…

    7 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)
  18. 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)
  19. 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)
  20. 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)
  • Don't see your idea?