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

172 results found

  1. 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'

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

    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

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

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

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

    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

    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)
  6. 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.fnlistextendedproperty('blah','schema',schemaname(T.schemaid), '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…

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

    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)
  8. There is no option in CLAUSES > JOIN to place AND on new line (Right aligned to INNER) and in Data (DML) there isn't an option to put AND on new line. Lots of tables I join on I am joining on 2 columns and I prefer to have the AND a.col1 = b.col1 on a new line as well.

    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. The new option would allow intending from alias (in alias = expression notation)

    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. I've created a few different style templates and named them accordingly, but when I want to add them as buttons to quickly change between styles, there is just a list of styles with no label so I don't know what any of them are.

    So I have to trawl through and add each of them as a menu button until the one I want appears, which is incredibly frustrating and time consuming! When its on the menu bar as a button, it has the appropriate name rather than just "style" so can this be added to the add button menu…

    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)
  11. There is a general configuration for operators AND/OR. However, for us it is important to distinguish between the different places they are used:

    • JOIN
    • WHERE
    • CASE ...

    Would it be possible to configure the AND/OR options inside each block?

    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)
  12. Allow the FROM, WHERE, GROUP BY, etc. clauses to indent from the select.

    Change
    SELECT Col1,
    Col2
    FROM Tab1
    WHERE a = b

    To

    SELECT Col1,
                  Col2
        FROM Tab1
        WHERE a = b
    
    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)
  13. It would be appreciated if you could enhance the SqlPrompt Formatting Styles functionality for the Clauses >>> JOIN section. I'd like the ON keyword to stay on the same line as the table-name, but when constraints are line-wrapped, I'd just like them to be "normally" indented.

    Presently, the only way to get close to this behavior is to check the "Place ON keyword on new line" checkbox and set "ON keyword alignment" to "Indented". But I don't want that box checked.

    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)
  14. Currently when SQL code is formatted, it will pick the first schema, if there are multiple objects with same name but having different schemas. It would be good if the choice is given to the user to choose which schema.objectname to use in this case.

    Also it's better if we can exclude certain schema's to be considered during code format. (But want to see the intellisense. Only to exclude them during the code format)

    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)
  15. Highlighting invalid objects is a nice feature, but it would also be nice to "find" invalid objects in a script.
    Running SQL Format on a script with an invalid object in it runs fine and gives no error, it just doesn't prefix the object (like a table) with the schema.
    It would be nice to have a quick and easy way to "go to next invalid object" or even for when you run SQL Format to have it bring up a warning saying "this/these object/s appear to be invalid".

    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)
  16. When using a BEGIN/END block, the "Insert Semicolons" feature adds a semicolon after "END" command, but not after the "BEGIN" command.

    One reason why this should be done, is the use of the THROW statement, which requires the previous statement to be terminated with a semicolon.

    Technically it is still runnable code, but, SSMS (as of version 18.8) sees it as a syntax error (see screenshot).

    I don't know which is the appropriate fix...waiting for SSMS to fix the syntax error it shows (but I doubt they will since the non-use of semicolons is deprecated), or if it's appropriate for…

    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)
  17. I prefer types without square brackets ( INT vs [INT], for example).

    If using square brackets for identifiers in the format options, there is no quick way to remove these.

    My work-around is -
    1. Apply Format Style option "Add/remove brackets + Remove Unnecessary brackets"
    2. Format the block of code
    3. Apply format Style option "Add/remove brackets + Add brackets to all identifiers"
    4. Format the block of code
    5. restore format Style option to original choice

    It would be nice to have a single action to do this, or to have a separate option in format styles to…

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