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. Setting the option to use spaces instead of tabs for intending (our house policy) only works for new tab presses.
    I would like a simple action that would replace all tabs in the current document with spaces -- using the tab-to-spaces value as set in options. Sublime Text has this and I use practically every time I edit anything.

    57 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)
  2. 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)
  3. 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)
  4. Please add support for
    SQL Prompt Support for Azure Synapse (Azure SQL Data Warehouse)

    35 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)
  5. Add additional option for "remove unnecessary brackets" which would keep brackets around syntax highlighted words.
    "Status", "description", and "Type" are examples of special words that are syntax highlighted, but they aren't full reserved keywords, so would want the brackets kept.

    How to configure and prevent SQL Prompt from removing brackets around Syntax highlighted words?
    We only have the following settings:
    a) Options > Inserted Code > Special Characters > Brackets > Enclose identifiers within square brackets [] = NO (which is our desire)
    b) Options > Format > Styles > Actions > run format > Add/remove square brackets = YES,…

    30 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. 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)
  7. I align aliases, commas, datatypes and expressions at the first tab stop following the longest element in the list. See examples below:

    -- Tilde character used as space replacement to cope with HTML formatting
    -- 2-character tabs are assumed below
    -- In a fixed-space font, the commas, = signs, data types and AS keywords would all line up vertically
    DECLARE
    ~~@x~~~~~~~~~~~~~~INT~~~~~~~~~,
    ~~@var~~~~~~~~~~~~VARCHAR(4)~~,
    ~~@longer_varname~VARCHAR(10)~,
    ~~@z~~~~~~~~~~~~~~DATETIME~~~~;

    SELECT
    ~~~~@longer_varname~=~'x'~~~~~~~,
    ~~~~@var~~~~~~~~~~~~=~'1234'~~~~,
    ~~~~@z~~~~~~~~~~~~~~=~GETDATE()~;

    SELECT
    ~~~~T1.shortfield~~~~~~~~AS~ShortField~,
    ~~~~AO.really
    longfield~~AS~LongField~~,
    ~~~~'x'~~~~~~~~~~~~~~~~~~~AS~XChar~~~~~~,
    ~~FROM~~~~~~~~dbo.table1~~~~~~AS~T1
    ~~~~LEFT~JOIN~dbo.another
    one~AS~AO~ON~T1.keyval~=~AO.keyval;

    EXEC~@x~=~dbo.SomeProc
    ~~@Param1~=~'3'~~~~~~~~~~~,
    ~~@P2~~~~~=~'Longer~Text'~,
    ~~@P3~~~~~=~4~~~~~~~~~~~~~;

    24 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)
  8. 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)
  9. 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)
  10. 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)
  11. 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)
  12. It would be awsome if there was an option that would format an SQL Script automatically after opening it in SSMS / VS. So if you load a file it would be formatted automatically with your selected formatting style. It would be great too if this auto format option could be switched on and off in the Options.

    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

    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)
  13. It would be really useful to be able to choose the default comment style as either inline -- or comment block /* */, and have that style be applied when executing an auto-format on the script.

    See https://www.erikdarlingdata.com/sql-server/please-use-block-quotes-for-code-comments-in-your-t-sql/ for more info

    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

    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)
  14. 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)
  15. I think it would be great if SQL Prompt had the functionality to expand a view that is used in a query. So if you have this schema:
    CREATE TABLE dbo.Person
    (
    PersonID INT IDENTITY(1, 1)
    PRIMARY KEY,
    LastName VARCHAR(30),
    FirstName VARCHAR(30),
    );
    GO

    CREATE TABLE dbo.Student
    (
    StudentID INT IDENTITY(1, 1)
    PRIMARY KEY,
    PersonID INT,
    StudentNo VARCHAR(100)
    );
    GO

    CREATE TABLE dbo.Class
    (
    ClassID INT IDENTITY(1, 1)
    PRIMARY KEY,
    ClassName VARCHAR(100)
    );
    GO

    CREATE TABLE dbo.ClassRoster
    (
    ClassID INT,
    StudentID INT
    );

    GO

    CREATE VIEW dbo.Students
    AS
    SELECT
    S.StudentID,
    P.LastName,
    P.FirstName,
    S.StudentNo
    FROM
    dbo.Person AS P
    JOIN dbo.Student AS…

    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

    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)
  16. Convert selected CODE or a complete stored procedure to Dynamic SQL Code.

    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

    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)
  17. 15 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)
  18. 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)
  19. I would be nice if SQL-prompt could warn against posible data truncation.
    Like assigning a int value to a tinyint field/variable or assigning a varchar(30) to a varchar(3).
    I want it both at an global analysis (like find invalid objects) and in the current scrip edit (while modifying a trigger / procedure / function).

    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

    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. 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)
← Previous 1 3 4 5 8 9
  • Don't see your idea?