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. Enhance tab to expand wildcards when using aliased tables

    Further to the idea presented here http://redgate.uservoice.com/forums/94413-sql-prompt-feature-suggestions/suggestions/1712871-enhance-press-tab-to-expand

    I would like to see a further enhancement

    If I have a query such as

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

    and I tab-expand the *, then the columns will be prefixed with the alias name, however if I have limited the query to

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

    and tab-expand, then SQL Prompt doesn't use the alias, it uses the tablename. I want to see the alias.

    9 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

      1 comment  ·  Expand wildcards  ·  Flag idea as inappropriate…  ·  Admin →
    • Remove/rename duplicate columns in wildcard expansions

      It'd be awesome if SQL Prompt could have the ability to automatically (or via key command) remove and/or rename columns that are duplicated when joining tables.

      That is, if you have three (3) tables defined and filled as such:

      DROP TABLE dbo.Grades
      DROP TABLE dbo.Student
      DROP TABLE dbo.Course

      CREATE TABLE dbo.Student
      (
      sid INT IDENTITY(1,1) NOT NULL,
      fname VARCHAR(10),
      lname VARCHAR(50),
      CONSTRAINT pk_Student PRIMARY KEY CLUSTERED (sid)
      )

      CREATE TABLE dbo.Course
      (
      cid INT IDENTITY(1,1) NOT NULL,
      cname VARCHAR(50),
      CONSTRAINT pk_Course PRIMARY KEY CLUSTERED (cid)
      )

      CREATE TABLE dbo.Grades
      (
      sid INT NOT NULL,
      cid INT NOT NULL,
      grade VARCHAR(2)…

      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 →
      • Collapsible fields in SELECT, UPDATE and INSERT

        When working with data warehouses one has to often write queries against tables with many, many columns. The best practice tells us to always exactly specify the columns one wants in the SELECT query. Problem is that there are so many columns to write out that scrolling becomes excessive and tedious. I've been wondering... Could SQLPrompt somehow turn the stuff between SELECT and FROM collapsible with little effort on part of the dev? A keyboard shortcut would be perfect. This could also work for, say, UPDATE between SET and FROM. What about collapsible field in INSERT? I always write out…

        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…

          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 - 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 →
            • INSERT INTO Wildcard

              When doing an INSERT INTO it would be nice if you could type INSERT INTO TableName (*) then if you tabbed after the * it would expand out all the columns for that table.

              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 →
              • Expand JOIN * into joining on all collumns

                When joining two tables with the same structure, it would be nice to be able to expand "JOIN *" into a JOIN clause with all columns.

                This is most useful when investigating issues or maintenance.

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

                  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 →
                  • Enhance tab to expand and name aliases table as prefix

                    When expanding a * in
                    SELECT * FROM dbo.Objekt AS O JOIN dbo.ObjektArtikel AS OA ON OA.ObjektNr = O.ObjektNr AND OA.DelObjekt = O.DelObjekt AND OA.LeveransNr = O.LeveransNr
                    I get
                    SELECT O.ObjektNr ,
                    O.DelObjekt ,
                    O.LeveransNr ,
                    -- /.../
                    OA.ObjektNr ,
                    OA.DelObjekt ,
                    OA.ArtikelNr ,
                    OA.LeveransNr ,
                    -- /.../
                    Which is great, but that would produce an error if inserted directly into a table..
                    "Column names in each table must be unique. Column name 'ObjektNr' in table '#ArticlesBelongingToPreBundles' is specified more than once."

                    If there was an option to prefix names with table alias like this...

                    SELECT O.ObjektNr O_ObjektNR,
                    O.DelObjekt O_DelObjekt, …

                    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 →
                    • Fix "expand wildcards" when there is no space after the wildcard

                      If there is no space between a wildcard (e.g., SELECT *) and the next statement, then when Format SQL expands the column list there will be no space between the last column and the next word, causing the script to error.

                      I found this out the hard way when trying to format a gnarly set of code from our offshore team - an example to reproduce the issue is below.

                      CREATE TABLE #MyTable (MyIntColumn INT, MyVarcharColumn VARCHAR(50))

                      SELECT *INTO #MyOtherTable -- note the lack of a space between the * and INTO
                      FROM #MyTable mt

                      DROP TABLE #MyTable
                      DROP TABLE…

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

                      Feedback and Knowledge Base