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 at http://www.red-gate.com/messageboard/viewforum.php?f=169.

How can we improve SQL Prompt?

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Keep statement terminator ";" at the end of single line statements

    Add option to "Global - Whitespace - Semicolons" to keep the ";" at the end of single line statement when "Whitespace before Semicolon" is set to "New Line Before"

    ex:

    print 'blah';

    declare
    x integer
    ,y integer
    ;

    1 vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
    • Enable customization For 'FOR XML PATH' on a different line

      Enable customization For 'FOR XML PATH'' on a different line.

      This is how it looks in V7 formatting style:

      SELECT PaymentIDs = STUFF(( SELECT DISTINCT
      ',' + iap.PaymentId
      FROM TestDB2..TestTable2 AS iap
      WHERE iap.LoadId = CONVERT(VARCHAR(50), trx.LoadId)
      FOR
      XML PATH('')
      ), 1, 1, '')
      ,CardholderName = CASE WHEN cdt.CHType = 1 THEN ISNULL(cdt.FirstName, '') + ' ' + ISNULL(cdt.Lastname, '')
      ELSE cad.CompanyAccountName
      END
      FROM TestDB1..TestTable1 AS trx;

      This is how it looks in V8:

      SELECT TestColumn = STUFF(( SELECT DISTINCT
      ',' + iap.PaymentId
      FROM TestDB2..TestTable2 AS iap
      WHERE iap.LoadId = CONVERT(VARCHAR(50), trx.LoadId)
      FOR XML PATH(''))
      ,1
      ,1
      ,'')
      FROM TestDB1..TestTable1…

      3 votes
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)

        We’ll send you updates on this idea

        0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
      • Include column picker for where clause and allow entering of variables/values

        When you type the WHERE clause, allow the user to choose from the column picker with textboxes on the right to allow the user to input the values.

        e.g.
        [ ] ID Value [_____________]
        [ ] Name Value [_____________]
        [ ] Surname Value [_____________]
        [ ] ID Number Value [_____________]
        [ ] Cellphone Number Value [_____________]

        0 votes
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)

          We’ll send you updates on this idea

          0 comments  ·  Intellisense  ·  Flag idea as inappropriate…  ·  Admin →
        • Instead of "Press Tab to expand wildcard", prompt for alternative tables or aliases to expand

          Instead of "Press Tab to expand wildcard", prompt for alternative tables or aliases to expand

          Example:

          select *
          from table t1
          join table2 t2 on t1.id = t2.id

          When cursor is on the wildcard the following options will be shown:

          Expand Wildcard
          * (Default Selected)
          t1.*
          t2.*

          1 vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  Expand wildcards  ·  Flag idea as inappropriate…  ·  Admin →
          • Tab History - sort or filter on evironment

            Allow me sort or filter the tab history list based on the environments that I have defined.

            1 vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)

              We’ll send you updates on this idea

              0 comments  ·  Tab history  ·  Flag idea as inappropriate…  ·  Admin →
            • Improve formatting for nested joins that are logically grouped with parentheses

              Using the default style with only the following adjustment:
              CLAUSES
              ··> join
              ····> on condition
              ······> Place on keyword on new line := False

              Currently, nested joins that are logically grouped with parentheses will format without spaces around the parenthesis, and all the tables are left aligned (example below).
              SELECT co.Name AS CompanyName,
              ·······ct.Name AS ContactName,
              ·······ph.Number AS PhoneNumber,
              ·······addr.Address AS MailingAddress,
              ·······city.Name AS City
              FROM Company AS co
              ····LEFT OUTER JOIN(Contact AS ct
              ····INNER JOIN Phone AS ph ON ph.ContactID = ct.ContactID
              ····LEFT OUTER JOIN(Address AS addr
              ····INNER JOIN City AS city ON city.CityID = addr.CityID)ON addr.AddressID = ct.AddressID)ON…

              1 vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
              • Tab History - Open all Closed Tabs

                Tab History - Open all Closed Tabs. Add a button to open all Closed Tabs in history. Possibly add a warning that this will take up much RAM.

                1 vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  Tab history  ·  Flag idea as inappropriate…  ·  Admin →
                • Outline for scripts

                  It would be very helpful if there was an outline for the script being edited. Say, a script has many "CREATE PROC"s. We could have a tree or a list or a drop-down, to view a list of CREATE PROCs and click to scroll to the section.

                  If a tree style is selected, this could be expanded into seconds inside each PROCs.

                  1 vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  User interface  ·  Flag idea as inappropriate…  ·  Admin →
                  • Format CASE Statement Based on Length of WHEN/THEN Clause

                    If it wouldn't be too difficult I'd like to see the ability to set THEN on a new line only if any of the WHEN statements exceed a certain length.

                    So this would result in THEN on the same line as WHEN:
                    CASE MyColumn
                    WHEN 'a' THEN '1'
                    WHEN 'b' THEN '2'
                    END

                    but this would split it out:
                    CASE MyOtherColumn
                    WHEN 'alphabet soup'
                    THEN 'this is a very long string and would be confusing on one line'
                    WHEN 'bravo foxtrot charlie'
                    THEN 'this is another very long string thank you for reading all of it'
                    END

                    2 votes
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                    • Format CTE closing parenthesis

                      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

                      1 vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                      • Make editor background color the same as the tab color

                        Making the editor background color the same as the tab color (especially for production database connections) will be a highly visible alert that you are working on a production database. This is especially helpful if you are working on multiple database instances concurrently and will help prevent executing on a production database accidentally.

                        1 vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          0 comments  ·  Tab coloring  ·  Flag idea as inappropriate…  ·  Admin →
                        • Press TAB to expand wildcard - when using group by

                          When adding group by to a select, it would be nice if the TAB-to-expand-wildcard would only include the columns in the group by

                          Consider this Select:
                          Select *
                          from tblA as a
                          inner join tblB as b on b.fk_tblA_id = a.id
                          group by b.Value

                          Today expanding the * will give:
                          a.id
                          ,a.value
                          ,b.id
                          ,b.fk_tblA_ID
                          ,b.value

                          This is actualy invalid sql as only the columns included in the group by can be in the select.
                          Instead it would be nice if the first TAB press would give the columns in the group by, so in this example just:
                          b.Value

                          I often…

                          3 votes
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  Expand wildcards  ·  Flag idea as inappropriate…  ·  Admin →
                          • Press TAB to expand wildcard - 2 step expand

                            With multiple tables joined in a select, make it optional to have multi level expansion

                            Consider this Select:
                            Select *
                            from tblA as a
                            inner join tblB as b on b.fk_tblA_id = a.id

                            Today expanding the * will give:
                            a.id
                            ,a.value
                            ,b.id
                            ,b.fk_tblA_ID
                            ,b.value

                            Instead it would be nice if the first TAB press would give:
                            a.*
                            ,b.*
                            Pressing again without moving the cursor could expand all * to the same result as today, but if the cursor is changed to a specific *, then only that * would be expanded

                            I often finde my self joining 3,4,5 tables or…

                            2 votes
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              0 comments  ·  Expand wildcards  ·  Flag idea as inappropriate…  ·  Admin →
                            • Include Identity Field in INSERT INTO script when SET IDENTITY_INSERT dbo.table ON is used

                              When we use

                              SET IDENTITY_INSERT dbo.TableName ON

                              then use INSERT INTO and then use tab to generate script, its not including the IDENTITY field in the Insert script

                              Then we need to manually type it

                              If the INSERT script can include IDENTITY field based on SET IDENTITY_INSERT ON or OFF, it would be a helpful feature

                              1 vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                              • Suggest correlated subquery "join" criteria

                                When doing a correlated subquery, like:

                                SELECT
                                FROM Table1
                                WHERE NOT EXISTS (SELECT *
                                FROM TABLE2
                                WHERE <--- pop up here

                                Do the same matching as if we had written:

                                SELECT
                                FROM Table1
                                JOIN TABLE2
                                ON <--- pop up here

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  0 comments  ·  Intellisense  ·  Flag idea as inappropriate…  ·  Admin →
                                • Align "then"

                                  Please add an option to align "then" keyword and the expressions.

                                  Current format:
                                  declare_@fooid_int_=_(case
                                  __________________________when_@barId_=_7_then_2
                                  __________________________when_@barId_=_800_then_1
                                  __________________________else_5
                                  ______________________end
                                  _____________________);

                                  Suggested format:
                                  declare_@fooid_int_=_(case
                                  __________________________when_@barId_=_7___then____2
                                  __________________________when_@barId_=_800_then____1
                                  __________________________else______________________5
                                  ______________________end
                                  _____________________);

                                  1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                  • New line after opening bracket

                                    Please add an option to insert a line break after opening bracket if brackets contain multiple lines.

                                    Current format:
                                    declare_@fooid_int_=_(case
                                    __________________________when_@barId_=_7_then_2
                                    __________________________when_@barId_=_8_then_1
                                    __________________________when_@barId_=_9_then_4
                                    __________________________when_@barId_=_10_then_3
                                    __________________________else_1
                                    ______________________end
                                    _____________________);

                                    Suggested format:
                                    declare_@fooid_int_=_(
                                    ____case
                                    ________when_@barId_=_7_then_2
                                    ________when_@barId_=_8_then_1
                                    ________when_@barId_=_9_then_4
                                    ________when_@barId_=_10_then_3
                                    ________else_1
                                    ____end
                                    );

                                    1 vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Align ON in JOIN Statements

                                      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

                                      2 votes
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Format dynamic SQL

                                        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.

                                        1 vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)

                                          We’ll send you updates on this idea

                                          0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Do not rename the inserted table.

                                          We are case sensitive so when you format inserted to Inserted the columns should be something like WHERE inserted.Name = 'bob' but instead the formatter makes it like this....

                                          SELECT *
                                          FROM Inserted
                                          WHERE inserted.Name = 'bob'

                                          Which fails on compile because of case sensitivity.

                                          1 vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)

                                            We’ll send you updates on this idea

                                            0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 32 33
                                          • Don't see your idea?

                                          Feedback and Knowledge Base