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

  2. It would great if there was an un-format SQL command, which would basically un-format the SQL by removing all the carriage returns, tabs, extra spaces, etc. I know it seems odd, but we have several applications that use the SQL via external files, so the formatting will not work, and we end up manually removing all the formatting.

    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 →
  3. Provide an option to not indent the FROM and WHERE clauses to remain them lined up with the SELECT clause while maintaining a single space after each clause.

    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 →
  4. 2012 keywords like LEAD( LAG( etc.

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

    We’ve released SQL Prompt 6 which includes support for 2012 analytic functions (LEAD, LAG, CUME_DIST, etc)

  5. Allow users to specify how CTEs should be formatted. Right now I get:

    WITH cte
    AS (
    SELECT
    Title
    ,FirstName
    ,LastName
    FROM
    isales.dbo.salesteam
    )
    SELECT
    Title
    ,FirstName
    ,LastName
    FROM
    cte

    What I would like is:

    WITH cte
    AS
    (
    SELECT
    Title
    ,FirstName
    ,LastName
    FROM
    MyTable
    )
    SELECT
    Title
    ,FirstName
    ,LastName
    FROM
    cte

    26 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 →
  6. When an IF is short and does not have a BEGIN END on it, have it format to a single line.

    Right now if you have

    IF @Parameter1 = 0
    RETURN -1
    IF @Parameter2 = 0
    RETURN -2

    I would like it to be:

    IF @Parameter1 = 0 RETURN -1
    IF @Parameter2 = 0 RETURN -2

    which would make it more compact.

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

  7. Have a function which is the opposite to 'Format SQL' so you can select a section of text and have all the Line Breaks and padding taken out. Currently I use HTML Shrinker Pro to do this, but it would be nice to select a block and one line it eg..
    @DateAppointed = CASE WHEN LEN(DateAppointed)> 1 THEN DateAppointed ELSE @Unknown END ,

    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 →
  8. SELECT Number1
    ,Number2
    ,Number3
    FROM table r
    JOIN table2 tf
    ON r.column = tf.column
    AND r.column = 0
    WHERE column = 0
    AND column1 = 2

    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 →
    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 need the ability to quickly switch between T-SQL Formatting styles.

    I work on a team where everyone likes code formatted differently. Also, we're required to use a specific format before checking SQL Code into TFS. I need a quick way to switch between styles so I can code in a format I like and then switch to our standard before check-in. Toad already offers this.

    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

    2 comments  ·  Format SQL  ·  Admin →
  10. I really like how SQLPrompt assists with Insert Statements. However, I am then left with a large list of comments which I'm not allowed to check into source control. Therefore, I have to manually delete each line of comments.

    Example:
    Insert into Blah blah..

    VALUES ('', -- fenumber - char(3)
    '', -- finumber - char(3)
    '', -- fpartno - char(25) )

    When I enter the values, I want to be able to auto-eliminate the comments.

    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 →
  11. sequences in sql 2012 is not supported by the formatter

    anywhere in the script file if the last line below is used it causes an error.

    CREATE SEQUENCE [dbo].[ReportComparisonSeq] AS INT START WITH 1 INCREMENT BY 1 NO CYCLE CACHE 10
    go
    DECLARE @Seq INT
    SELECT @Seq = NEXT VALUE FOR [dbo].[ReportComparisonSeq]

    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 →
  12. Allow the option to NOT indent else if statements. Each of the ELSE IF statements gets further indented and for large SQL it becomes indented off the screen. I can imagine this pattern could apply else where but for this specific use case our STPs that have this condition i simply can't format the sql because it requires me to horizontally scroll. Allowing me to disable indenting ELSE IF statements would solve this problem instantly.

    21 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 →
  13. Formatting a section (selected code block) with CTRL+K, CTRL+Y). This would allow me to highlight a section of a proc and format it to my liking and leave the (abomination) of the proc body untouched.

    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

    completed  ·  3 comments  ·  Format SQL  ·  Admin →
  14. Currently, no matter what settings are applied, table names are always placed on a new line, for example:

    SELECT
    ID,
    Thing

    FROM
    TableName

    JOIN
    OtherTableName
    ON blah=moo

    WHERE
    something <> something else

    My personal preference is for:

    SELECT
    ID,
    Thing

    FROM TableName

    JOIN OtherTableName
    ON blah=moo

    WHERE something <> something else

    Please can we have an option to achieve table names on the same line as their action (FROM / JOIN)

    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

    11 comments  ·  Format SQL  ·  Admin →
  15. Include an option when reformatting SQL to automatically add semicolons at the end of each statement if they are missing.
    While in most cases SQL Server 2005 and 2008 don't require this, the 2008 docs mention that a future version might.
    and it may also be helpful if trying to move code from SQL Server 200x to a dialect which does require them.

    85 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

    9 comments  ·  Format SQL  ·  Admin →
  16. I would like an option to align the type declarations, for example when declaring the columns in a table variable I currently get:
    DECLARE @MyExample TABLE
    (
    MyCol1 INT ,
    MyOtherCol VARCHAR(10)
    )

    Which I would quite like to see laid out as:
    DECLARE @MyExample TABLE
    (
    MyCol1 INT ,
    MyOtherCol VARCHAR(10)
    )

    The same is true for all other places where I'm declaring, so the parameters for a procedure for example

    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

    4 comments  ·  Format SQL  ·  Admin →
  17. I would like the ability to get Format SQL to handle my JOIN formatting - I like to have my JOINs look like this:

    SELECT
    (columns)
    FROM
    sys.tables t
    INNER JOIN
    sys.indexes i ON t.OBJECTID = i.objectid

    That is: I want to have my tables being joined lined up with the (intended) table in the FROM clause, and I like to have my JOIN condition on the same line as the joined table.

    Right now, I cannot seem to get this to work - the table name and join condition are always stuck onto the same line as…

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

  18. When the WITH clause is specified in the FROM clause on a JOIN, Format SQL pushes the join condition out to the WITH.
    Like this:
    FROM
    TableA WITH (NOLOCK)
    JOIN TableB WITH (NOLOCK)
    ON TableA.ID = TableB.ID

    I would like it to behave like it does when the WITH is not present

    FROM
    TableA WITH (NOLOCK)
    JOIN TableB WITH (NOLOCK)
    ON TableA.ID = TableB.ID

    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

    2 comments  ·  Format SQL  ·  Admin →
  19. When copying a list of items from something like Excel, it would be lovely to have a feature in Prompt which would highlight the list, hit a key stroke and it would place quotes around each item and a comma after them.

    It would stop me bashing the quote + arrow + comma keys at the speed of light.

    22 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

    9 comments  ·  Format SQL  ·  Admin →
  20. I believe the DISTINCT keyword should remain on SELECT line but at least maintain the indentation please. Thanks

    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 →
  • Don't see your idea?