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

80 results found

  1. CREATE FUNCTION MyFunc()
    RETURNS INT
    AS
    BEGIN
    ----IF 1=1
    --------BEGIN
    ------------<some code>
    --------END
    END
    END

    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

    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)
    completed  ·  Aaron Law responded

    This should already be an option in SQL Prompt under Format→Schema statements→Indent contents.

  2. Place semi-colon on new line.

    I frequently format my statements as I'm developing them, but multiple times now I've started to add an Order By or some other clause after the auto-inserted semi-colon. I would like to see an option to place the semicolon on the line following the sql statement rather than directly after. This would enable me to start typing at the start of the next line without having to check if a semicolon had been added to the preceding line.

    Example:
    Select * From Table
    Where A = 1; -- Semicolon added by formatting
    Order By A

    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

    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. SELECT
    *
    FROM
    Temp1

    --Remove this kind of extra spacing between statements option is Needed
    

    SELECT
    *
    FROM
    Temp2

    --Remove this kind of extra spacing between statements option is Needed
    

    SELECT
    *
    FROM
    Temp3

    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)
  4. when creating a WHERE colname IN ('a','b','c')

    it would be nice if you could paste a set of rows from excel into SSMS and then add the quotation marks and commas

    i.e.

    A
    B
    C

    becomes

    'A',
    'B',
    'C'

    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)
  5. Please provide the option to format IF statements as follows, based on the format settings sample.

    IF @productType IN ('a', 'b', 'd', 'g', 'i', 'O', 'Q', 'X', 'Z') BEGIN

    ----IF @cost <= @compareprice BEGIN

    --------PRINT 'Less than $' + CAST(@compareprice AS varchar(20))

    ----END ELSE BEGIN

    --------PRINT 'Exceeds $' + CAST(@compareprice AS varchar(20))

    ----END

    END

    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)
  6. I think I 've found a bug...
    If you Format this SQL

         DECLARE @Translations TABLE
            (
              [FundTypeId] INT NOT NULL ,
              [ColumnName] NVARCHAR(128) NULL ,
              [ColumnValue] NVARCHAR(256) NULL ,
              [InsertedAt] DATETIME NULL ,
              [InsertedBy] NVARCHAR(256) NULL ,
              [LastUpdatedAt] DATETIME NULL ,
              [LastUpdatedBy] NVARCHAR(256) NULL ,
              PRIMARY KEY ( [FundTypeId] )
            );
    
         SELECT *
         FROM   ( SELECT    [pt].[FundTypeId] ,
                            [pt].[FundType] ,
                            [pt].[Comment] ,
                            [pt].[InsertedAt] ,
                            [pt].[InsertedBy] ,
                            [pt].[LastUpdatedAt] ,
                            [pt].[LastUpdatedBy]
                  FROM      @Translations AS [tmp] PIVOT ( MAX([ColumnValue]) FOR [tmp].[ColumnName] IN ( [FundType], [Comment] ) ) AS [pt]
                ) AS [tmp];
    

    ... it will break the code as the MAX function of…

    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)
  7. It would be nice if one could click a button and get the AS keyword between an object name and its alias. This would help with code that doesn't use AS to separate the two. And would also help readability.

    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)
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 7.3 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  8. ;
    RECEIVE TOP(1)
    @h = conversationhandle,
    @t = message
    typename,
    @b = message
    body
    FROM SimpleQueueTarget

    From the Service Broker Workbench on Simple Talk.

    It only moves the semicolon to a separate line. No errors. Ignores "comma at start".

    And, yes, the @'s above probably start in column 1, when they're actually in col 5.

    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)
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 8 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  9. We have a lot of legacy code that is written as

    SELECT Field1 as Name1, Field2 Name2 FROM Table X
    (Sometimes they use AS when setting the alias, othertimes they do not).

    I would love the ability to convert this to
    SELECT
    Name1 = X.Field1
    , Name2 = X.Field2
    FROM Table X

    Both having the ability to switch between Name = Value and Value AS Name and to auto add the alias to all fields.

    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

    6 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)
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 7.3 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  10. Option to remove trailing spaces from script lines. This can be done via search/replace functionality but it would be nice to have this taken care of automatically during the SQL code reformatting

    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

    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)
  11. When formatting SQL, add an option to force all possible columns/objects/whatever to be qualified with square brackets. So:

    CREATE TABLE #qqqqq (aaaaa INT,bbbbb INT,ccccc VARCHAR(5));
    Becomes: CREATE TABLE [#qqqqq] ([aaaaa] INT,[bbbbb] INT,[ccccc] VARCHAR(5));
    Or: CREATE TABLE [#qqqqq] ([aaaaa] [INT],[bbbbb] [INT],[ccccc] [VARCHAR](5));

    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

    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)
  12. When a --#TODO: or --#HACK is written on our code, it could be helpful to highlight it in order to give an alert to the reader. In addition it can be very helpful to let the user to configure the pattern (i.e. --#MyTerm).

    46 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)
    completed  ·  Thomas Walsh responded

    We’ve released support for highlighting TODOs in version 9 of SQL Prompt as part of its new code analysis feature.

    You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.

    We’re marking this request as completed, but if you feel strongly about being able to configure the term, please feel free to open a new suggestion.

    Kind regards,

    The Prompt Team

  13. Sample query (spaces marked with underscores):

    SELECTstaffId, staffName, a
    FROM
    __personnel

    SELECT and FROM have whitespace after them to align the rest of the statement. This formatting style is tedious to maintain and almost nowhere to be found in real codebases or on the web. Please support the more common code style:

    SELECTstaffId, staffName, a
    FROM
    personnel

    Just one space.

    41 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)
  14. Similar to the existing Qualify Object Names and the other pending request to fix case of all object names, I would like to have an option to add brackets added to all database object names (columns, tables, schemas) where they are missing.

    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

    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)
  15. Currently when formatting a Create table command the SQL Prompt is moving the "Default" to a next line and indenting it...
    like this
    [insertDT] DATETIME NULL
    [______INDENT] DEFAULT GETDATE()
    ,[ActualMU] INT NULL
    [
    ___INDENT]DEFAULT 0
    ,[PlannedMu] INT NULL
    [
    ___INDENT]DEFAULT 0
    ,[CompletedDT] DATETIME NULL
    [
    ___INDENT___] DEFAULT GETDATE()

    And the format that I would like to see (making easier to read) is
    keeping all definition of each field in the same line, like

    ,[insertDT] DATETIME NULL DEFAULT GETDATE()
    ,[ActualMU] INT NULL DEFAULT 0
    ,[PlannedMu] INT NULL DEFAULT 0
    ,[CompletedDT] DATETIME NULL DEFAULT…

    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)
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 8 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  16. When a word is entered in a comment block, that is the same as a keyword (e.g. FROM), SQL Prompt should not automatically convert the word to uppercase.

    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)
  17. Its a very nice tool who made developer life very easy and do a major and boring task of code formatting by just pressing CTRL+K+Y.
    i need a feature who can help developer very much like 1)If there is a SQL Insert query and i select a field it should highlight the value assigned to that selected field because finding this become more painful in formatted code.

    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

    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. Would love to be able to have all predicates at the same indent level ie:

    WHERE something = yetsomethingelse
    AND somethingelse = anotherthing

    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

    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. When formatting a case statement I want the case keyword to show in uppercase just like the when and end keywords. Now initially it uppercases CASE but when running SQL format it turns it to lowercase (bug?) See example below of the current format behaviour.

    SELECT case WHEN 1 = 1 THEN 1
    ELSE 0
    END

    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)
  20. Frequently I need to debug application generated SQL obtained via Profiler. Parameterized queries are often implemented with sp_executesql.

    I love using Format SQL to make a single line monster query into something I can actually read. But when it's stuck in an spexecutesql call the format function doesn't touch it. I have to:
    Remove "Exec sp
    executesql".
    Remove the apostrophes around the query SQL. For big queries this is really painful, especially if the query itself contains apostrophes.
    Remove the apostrophes around the parameter defenitions.
    Move the parameter definitions to the top and add a DECLARE.
    Move the parameter…

    18 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

    7 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)
    completed  ·  Andrei Rusitoru responded

    This feature was released in version 7.3 of SQL Prompt.

    If there are any missing features please let us know by creating a new suggestion.

    Kind Regards,
    The Prompt Team

  • Don't see your idea?