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?

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(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. Format SQL in Visual Studio (C #, etc)

    In my VS tab:

    1. I want to highlight a string variable assignment contain a SQL statement, run Format SQL from the SQL Prompt menu in Visual Studio and have it output a multiline statement in the appropriate language for the file (aspx, cs, etc).

    Start with:
    string sql = "SELECT o.name,
    c.name
    FROM sys.objects AS o
    INNER JOIN sys.columns AS c
    ON o.object_id = c.object_id;"

    format it into:

    string sql = "SELECT o.name,"
    sql += "c.name"
    sql += "FROM sys.objects AS o"
    sql += "INNER JOIN sys.columns AS c"
    sql += "ON o.object_id = c.object_id;"

    2. I want to…

    2 votes
    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)
      You have left! (?) (thinking…)
      0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
    • CONVERT () - style parameter

      It would be very nice when you could list suggestions for the third style parameter of the CONVERT / TRY_CONVERT-function (see https://msdn.microsoft.com/en-us/library/ms187928.aspx), similar you did it for the object type parameter in OBJECT_ID(), because I'm very tired to open the MS documentation every few days.

      It would be nice, if you could make it specific to the data type (first or (!) second parameter e.g. a date/time or a float or xml), but because this could be hard (when using functions or a CASE) it would be sufficient to list them in the order as on the MS-Page (date-styles…

      3 votes
      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)
        You have left! (?) (thinking…)
        0 comments  ·  Intellisense  ·  Flag idea as inappropriate…  ·  Admin →
      • Format statement or batch when delimiter is enetered

        An option enabling automatic statement and/or batch formatting when a statement delimiter or batch delimiter is keyed in would be very helpful.

        This is one of the very few features I miss after moving to SQL Prompt from SQLComplete.

        2 votes
        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)
          You have left! (?) (thinking…)
          0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
        • Format when code is pasted into document

          An option to enable automatic formatting when code is pasted into a document would be great.

          2 votes
          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)
            You have left! (?) (thinking…)
            0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
          • Please make this work in harmony with SSMS tools

            I work in an environment where we have 200+ databases. Using SSMS Tools you are able to "run on multiple databases" which is perfect for implementing the same script across all 200 databases.
            The problem comes when SQL Prompt tries to then pre-cache all 200 databases even though I have no intention of typing anything I just want the script to run as is.

            3 votes
            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)
              You have left! (?) (thinking…)
              1 comment  ·  Intellisense  ·  Flag idea as inappropriate…  ·  Admin →
            • RTRIM, Tabs and line breaks

              It would be nice to have a function that are called from this Control-Key menu (plus the default SQL Prompt menu) and does the following to the selected (or complete, if nothing is selected) text:

              - RTRIM every line
              - replace tabs by spaces (not always 4; only until <currentColumn>% 4 = 0)
              - converts char(10) to char(13) + char(10) (when there is no char(13) before)

              Because I'm not the only user, the second step could convert spaces to TABs too (depending on the SSMS options) and the third step could remove char(13), if someone wants to use the SQL…

              4 votes
              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)
                You have left! (?) (thinking…)
                0 comments  ·  Flag idea as inappropriate…  ·  Admin →
              • Formatting of AT TIME ZONE

                In SQL Server 2016 it is now possible to calculate between timezones. Currently it gives me an error, when I want to format it. The syntax is also not allowed at the moment.

                1 vote
                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)
                  You have left! (?) (thinking…)
                  0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                • Is it possible to programmatically modify text at tab stops?

                  In SQL Prompt snippets, we can use $tab_stop$ syntax to define a tab stop position. Currently the only thing we can do against a tab stop is set its default text. I want to know if it's possible to add some kind of scripting feature to tab stops. That way we users can do a lot of stuff by ourselves. For example we can using string functions to modify $SELECTEDTEXT$ to make it what we want. There are some editors in the market have this feature. For example emacs's yasnippet has this feature and you can call any elisp functions…

                  1 vote
                  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)
                    You have left! (?) (thinking…)
                    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                  • Is it possible to add the reverse feature of inline exec?

                    It's great you guys added the "inline exec" feature in the most recent build. Its reverse feature sometimes is useful too. Is it possible to add "inline exec"'s reverse feature?

                    Take a look at the following forum post for more details:https://forums.red-gate.com/viewtopic.php?f=169&t=80363&sid=aea14feee02ccaef58b093d5af21db7e

                    1 vote
                    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)
                      You have left! (?) (thinking…)
                      0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                    • format the pseudo column %%physloc%%

                      There is an undocumented column in SQL Server called %%physloc%%. You can get more information from here at http://www.sqlskills.com/blogs/paul/sql-server-2008-new-undocumented-physical-row-locator-function/ It's undocumented but it's very useful sometimes. Right now SQL Prompt can't format scripts that have %%physloc%% in them. Not sure if you guys want to add the support to format it.

                      Thanks.

                      1 vote
                      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)
                        You have left! (?) (thinking…)
                        0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                      • no double AS table alias

                        I have the following statement:
                        SELECT * from dbo.table1 AS t1

                        The option to auto-apply table aliases (including AS) is enabled

                        When I change table1 to e.g. table1_details (using code completion) it changes my query to

                        SELECT * from dbo.table1_details AS td AS t1

                        which is syntactical incorrect (because of the double AS)
                        -> please either skip the add-alias (if there is already one) or change the existing alias to the new one

                        I'd prefer if you would not add another alias because sometimes I want to run the same query (same columns in the WHERE condition) for different tables…

                        3 votes
                        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)
                          You have left! (?) (thinking…)
                          0 comments  ·  Qualify object names  ·  Flag idea as inappropriate…  ·  Admin →
                        • Align FROM objects. In FROM clause, let JOIN be AFTER table/view name, so that from objects can line up.

                          FROM dbo.TableA INNER JOIN
                          dbo.TableB ON TableA.SomeColumn = TableB.SomeColumn

                          1 vote
                          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)
                            You have left! (?) (thinking…)
                            0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                          • Highlight/execut current subquery

                            Can we get a shortcut to highlight or run the current subquery/cte/nested query?

                            For instance in this example it would highlight/run the entire 'SELECT TOP 100 * FROM sys.objects' it the cursor was placed within that section of code.

                            DECLARE @DynSQL VARCHAR(MAX);
                            SELECT @DynSQL = ISNULL(@DynSQL + ';', '') + 'select 123'
                            FROM (SELECT TOP 100 * FROM sys.objects) a;

                            In quite lengthy queries this utility would be very helpful. Many times a subquery may be moved around, perhaps changed to a temp table insert, or you may just want to see the output of it, and it's sometimes finicky…

                            3 votes
                            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)
                              You have left! (?) (thinking…)
                              0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                            • create or alter

                              SQL server 2016 SP1 introduced the "CREATE OR ALTER" PROCEDURE/VIEW - syntax, which would be very nice to have support for.

                              https://support.microsoft.com/en-us/kb/3190548

                              0 votes
                              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)
                                You have left! (?) (thinking…)
                                0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                              • Automatic refresh of suggestions for Cross Database queries

                                Please implement Automatic refresh of suggestions for Cross Database queries

                                Ex. when we write a query like this

                                SELECT * FROM NewDatabaseName.dbo.Table, Even if we press Ctrl+Shift+D it doesn't refresh the suggestions for the objects in NewDatabaseName, it only refreshes the suggestions for whatever the database its currently connected

                                The workaround I am using currently is, switch to the newdatabasename by

                                "use newdatabasename; go;"

                                then press Ctrl+Shift+D

                                Then change to old database "use currdatabasename; go"

                                Thanks
                                Arun

                                6 votes
                                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)
                                  You have left! (?) (thinking…)
                                  0 comments  ·  User interface  ·  Flag idea as inappropriate…  ·  Admin →
                                • export to excel options

                                  Hi - export to excel is a great feature. if it could be extended in 2 ways it would be even better.

                                  1. copy the sql used to produce the results (and date, server info) into a separate tab called 'sql' or something. this way data extracts will be 'auditable' and re-runnable.

                                  2. have some export options (top row = bold, highlighted, freeze top row). column autowidths applied.

                                  the second one can be done with a macro in the excel template but would be a nice to have.

                                  6 votes
                                  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)
                                    You have left! (?) (thinking…)
                                    0 comments  ·  User interface  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Format current statement

                                    Hi!

                                    It would be nice to have the option to format the current statement only to avoid reformatting everything in the document.
                                    At the moment I need to highlight the statement I would like to format which is not that handy.
                                    I guess this should not be a big deal for you cause "execute current statement" works already.
                                    If possible I would like to see that option as part of the context menu and as a (key) shortcut.

                                    Thanks for looking into this!

                                    Torsten

                                    1 vote
                                    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)
                                      You have left! (?) (thinking…)
                                      0 comments  ·  Format SQL  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Export all results to Excel, not just a single table

                                      It would be awesome if the Results tab could be right-clicked (when results are in a grid), and then have an option to export all tables to Excel, with each table being in a new tab. Currently I can only export one table of results at a time to Excel, and if I need to do multiple tables then multiple sheets are opened.

                                      4 votes
                                      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)
                                        You have left! (?) (thinking…)
                                        0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                      • index

                                        Hi!

                                        Would be nice to have formatting options for index / constraint definition.
                                        For example

                                        ALTER TABLE list.cost_per_unit
                                        ADD CONSTRAINT PKCL_cost_per_unit_ID_cost_per_unit PRIMARY KEY CLUSTERED (ID_cost_per_unit) WITH (FILLFACTOR = 100) ON [DEFAULT];
                                        GO

                                        should look like

                                        ALTER TABLE list.cost_per_unit
                                        ADD CONSTRAINT PKCL_cost_per_unit_ID_cost_per_unit
                                        PRIMARY KEY CLUSTERED (ID_cost_per_unit)
                                        WITH (FILLFACTOR = 100)
                                        ON [DEFAULT];
                                        GO

                                        4 votes
                                        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)
                                          You have left! (?) (thinking…)
                                          0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                        • sometimes suggestion bocks "hangs" in management studio, it remains visible.

                                          It would be cool to have something like "restart SQL Prompt"
                                          current SQL Prompt Version: 7.2.2.273
                                          current Management Studio Version: 12.0.2000.8

                                          1 vote
                                          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)
                                            You have left! (?) (thinking…)
                                            0 comments  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 28 29
                                          • Don't see your idea?

                                          Feedback and Knowledge Base