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. IF Statement block formatting is messed up

    IF 1 = 1
    BEGIN
    PRINT 'DO STUFF'
    END

    becomes

    IF 1 = 1 BEGIN
    PRINT 'DO STUFF';
    END;

    which is what I want...I want to leave the BEGIN END indention

    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)
  2. Would like to control formatting of the OVER clause. E.g I would like the complete "(Partition by ... order by ...) as xyz" on one line, but today it's overrdden by other options.

    28 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)
  3. Would be great to be able to add user specific outlining, so that you could add + & - where ever you choose in a sql script to collapse down certain parts. The CRM system that I support has a create contact table import with 200 columns which is regularly used and this functionality would be great when having to resort to using this import etc...

    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

    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. Currently the behavior for inserting a full INSERT statement is that it produces something like this:

    INSERT INTO dbo.ContactPictures
    ( InterActionPersonalContactID ,
    InterActionFirmContactID ,
    ImageFileStoreFilePathSegment ,
    Source ,
    ManuallyCreatedByUserAccountName ,
    DateTimeLastUpdated
    )
    VALUES ( 0 , -- InterActionPersonalContactID - int
    0 , -- InterActionFirmContactID - int
    '' , -- ImageFileStoreFilePathSegment - varchar(256)
    '' , -- Source - varchar(20)
    N'' , -- ManuallyCreatedByUserAccountName - nvarchar(40)
    GETDATE() -- DateTimeLastUpdated - datetime
    )

    Hard-coded values are rarely what's needed, though; it would be very useful if it could generate variables and use them in the statement, like this:

    DECLARE @InterActionPersonalContactID INT = 0…

    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

    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. My default preference is to maintain the ON keyword without a new line. I would like to be able to CONDITIONALLY place the ON keyword on a new line if, and only if the ON keyword together with the associated ON condition exceed a configurable wrap threshold.

    Example:
    -- Yield this >>>>
    SELECT *
    FROM Person.Address
    INNER JOIN Person.StateProvince
    ON StateProvince.StateProvinceID=Address.StateProvinceID
    -- >>>> instead of

    SELECT *
    FROM Person.Address
    INNER JOIN Person.StateProvince ON StateProvince.StateProvinceID=Address.StateProvinceID
    -- Assuming the JOIN clause exceeds the wrap length
    -- <<<

    This is particularly useful if the "Place JOIN table on new line" is NOT selected…

    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. Similar to the CTE request https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/19545028-format-cte-closing-parenthesis

    Aligning the closing parenthesis on its own line, in the same column as the opening paren, makes the subquery stand out, as well as making the alias stand out.

    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)
  7. if blah=1
    ____return 1;

    if blah=2
    _begin
    _
    return 2;
    _end
    else
    _
    return 0;

    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

    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)
  8. Arithmetical expressions and compound logical expressions all consist of operations and expressions with parentheses and orders of precedence. All of these should have the options for aligning operands, aligning parentheses, adding parentheses to make the default orders of precedence explicit. All expressions are subordinate to clauses so they should be indented under WHERE, ON, SELECT, WHEN.

    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)
  9. It would be nice if the IN clause were formatted like a logical function that returns a value so that it followed the options and rules for parentheses and were indented according to its place in the logical expression. (paying attention to the ANDs and ORs if present)

    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)
  10. It would be cool if SQL Prompt was able to remove trailing whitespaces/tabs not only for T-SQL, but also for comments.

    It's not something crucial, but rather nice-to-have

    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. Add option to leave semicolon on same line if statement only use one line.

    My idea is an additional to the idea captured in the "semi colon placed on new line" request.

    It would be nice to have checkbox for the semicolon-on-new-line option to not move the semicolon to a new line if the statement is ONLY one line.

    For example:
    SELECT TOP 10 * FROM dbo.Table
    ;
    should be
    SELECT TOP 10 * FROM dbo.Table;
    instead, but
    SELECT TOP 10 *
    FROM dbo.Table
    ;
    will remain unchanged by formatting.

    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)
  12. In SQL Prompt 8, multiple-line comment blocks (surrounded by /* */) are automatically indented to the SQL code surrounding them when formatting.

    Can you please add an option to preserve the indentation of these blocks? My team keeps most comment blocks left-aligned for consistency and readability, but SQL Prompt will automatically move them when formatting.

    This was not an issue in SQL Prompt 7, so all of our comment blocks are now moving when upgrading to SQL Prompt 8 and there is no option to preserve them. Thank you.

    23 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. Complex multi-line statements are much easier to read when separated by an empty line above and below them. Please add an option to turn on "Empty Line Above/Below Multi-Line Statements".

    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)
  14. It would be nice to have an option under Formatting Style -> CTE to allow closing parenthesis behavior, just like the opening parenthesis one:
    - Place closing parenthesis on new line
    - Closing parenthesis alignment

    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

    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. Please add an option to align "then" keyword and the expressions.

    Current format:
    declare@fooidint=(case
    _______________________when@barId=7then2
    __
    ___________________when@barId=800then1
    __
    ___________________else5
    __
    _______________end
    _
    _________________);

    Suggested format:
    declare@fooidint=(case
    _______________________when@barId=7then2
    _
    ___________________when@barId=800_then1
    __
    ___________________else________________5
    _
    _______________end
    _
    _________________);

    13 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. I really like the latest formatting flavours. Aligning the equivalency symbols in joins is nice, but could I also align the ON keyword? Or pick which one I want to align on.

    SELECT *
    FROM table1 a
    JOIN Table2 b__ON a.foo = b.foo
    JOIN Tab3 c
    ___ ON b.fa__= c.fa

    20 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. We use a lot of dynamic SQL. I'd like to be able to format dynamic SQL that is in a string, eg. and NVARCHAR. e.g.

    Input: DECLARE @sql NVARCHAR = '

    SELECT foo from bar where foobar = ''foobarred''
    '

    I'd like to be able to highlight the text inside the NVARCHAR for formatting. SQL Prompt would need to handle doubled quotation marks as in my example above.

    17 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. Provide an option in Styles to let the right hand side of clauses in UPDATE statement be aligned.

    Example:

    UPDATE~~EDSV
    SET~~~~~eDocSessionID~~~~~~~~~~~~~~~~~~~~~=~CONSV.eDocSessionID~,
    ~~~~~~~~eDocSessionKey~~~~~~~~~~~~~~~~~~~~=~CONSV.eDocSessionKey~,
    ~~~~~~~~eDocSessionValue~~~~~~~~~~~~~~~~~~=~CONSV.eDocSessionValue~,
    ~~~~~~~~eDocSessionValueTextStyleOverride~=~CONSV.eDocSessionValueTextStyleOverride~,
    ~~~~~~~~eDocSessionValuePositionOverride~~=~CONSV.eDocSessionValuePositionOverride~,
    ~~~~~~~~eDocSessionValueLockdown~~~~~~~~~~=~''
    FROM~~~~eDocStd2.dbo.eDocSessionValues~AS~EDSV
    ~~~~~~~~INNER~JOIN~#changedOrNewSessionValues~AS~CONSV~ON~CONSV.eDocSessionID~=~EDSV.eDocSessionID
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~AND~CONSV.eDocSessionKey~=~EDSV.eDocSessionKey;

    42 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

    5 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. I don't want to use brackets for my code (unless I have to). So, for example, dbo.Orders is fine, but dbo.Order isn't. It would be nice if SQL prompt caught this and automatically enclosed the SQL Keyword "Order" in square brackets (i.e. dbo.[Order] AS o)

    51 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)
  20. Hi!

    I would be nice to have the option to enable word wrap for the comments as well.
    The number of maximum characters for the comment should be aligned with "Wrap lines longer than" for SQL statements.

    19 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?