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

639 results found

  1. These are the typical formatting styles I use that I would like to see definable in SQL Prompt. Currently, I use a style that gets me close then manually format the remainder to the code:

    Regarding the desired format of

    1) SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY all lined up
    2) TAB after SELECT, followed by first 'column'
    3) Subsequent columns on separate lines and lined up with the first one.
    4) TAB after any CASE followed by first WHEN
    5) Subsequent WHENs lined up with first one
    6) TAB before THEN (i.e. indented one tab from…

    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

    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)
  2. sometimes I need same string between different tabs in Tab History. each time I need to copy/paste the desired string. Would be nice if it would remember the most recent used searches same way as any Search box

    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  ·  Tab history  ·  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. To help our developers we - as dba's - perform validation against their procedures and database code. The library of rules that is incorporated in SQLPrompt could be a good rule of thumb for the basic stuff of reviewing, so that we can focus on other stuff when validating.
    Is it possible to run the rules "engine" of SQLPrompt against an existing database without having to open the code manually?

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. I would like to only affect the placement of commas in a column list, without applying other formatting options. This would work similar to Ctrl-B, Ctrl-B to remove brackets or Ctrl-B, C to insert semicolons, in that no other formatting would take place.

    There are times I have a rather well-formatted script but it has been written with commas at the start of the line and I prefer them at the end. A new shortcut would toggle placing commas at the start or end of the line without affecting other formatting within the script.

    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)
  5. When the option to insert a values clause with default values for an INSERT statement is in force, the default values used by SQL prompt ignore nulls. e..g if your table is CREATE TABLE foo (bar int NULL) and you let SQL Prompt build an INSERT with default values, it uses 0 as the default for column bar. This is wrong. The true default is NULL. It would be better if SQL Prompt just used a value clause like :

    VALUES (DEFAULT)

    and let SQL Server figure out the default. Worse yet, check out this table and the generated code:

    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

    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 have different wants for parentheses rules: Collapse short content or not, Having Parentheses on separat lines or leading the content, etc. It all depends on the context. But currently the setting is global.

    I would like to be able to define one rule for, say, Primary Key definitions, and another rule for, say, the columns of a table.
    I would want one thing for Control Flow sections, and another thing for Variables declarations.

    Today, I need to choose which one to be dominant (or stop using FORMAT SQL on the entire script, but just highlight the block where I…

    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

    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. In SQL Prompt, Formatting Styles, I would like to differentiate the “Short parentheses contents” behavior, so it didn’t impact the primary key when I add a Constraint Primary Key Clustered at Create Table time.
    I like my PK fields to stand out, not hide in a block of text.
    But I also like any other listing of a few fields to be kept on a single line, and not bloating the screen for no reason at all.
    Currently, I can’t have both.

    In short, I want

    CREATE TABLE dbo.Orders
    (
    OrderDate DATETIME NOT NULL,
    OrderID INT NOT NULL,
    CustomerID INT…

    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)
  8. If I declare variables and assign them values (either in declaration or subsequent SET/SELECT statement, it would be very helpful if SQL Prompt, along with displaying the declaration (e.g. @MyVar int (Scalar variable) in the pop-up, would display the last know value. So, if my declaration was:
    DECLARE @MyVar INT = 123
    the popup would show something like @MyVar int = 123 (Scalar variable).
    I realize some might be rather long (string) or not displayable at all (e.g. table variables, cursors, etc.) but what appropriate showing the value that was set and last known could be very helpful in line…

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  9. Please allow CASE statements to start on their own line, preferably indented from the line before, rather than starting way, way off to the right when there's a significant amount of stuff before them. Nested CASE statements are nearly unreadable when they're so far off the screen, for complex or nested statements.

    This is a pretty simple example, but I've got real ones where the WHEN is so far over I can't even tell it's there without scrolling.

    SELECT
    CASE
    WHEN @SPID = 3 THEN 'th'
    WHEN @spid = 88 THEN 'bobasdlkfjalk;sdfjalks;djfla;skjfdlkasfjlks' + CASE
    WHEN @SERVERNAME = 'bb' THEN 'a'…

    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

    1 comment  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  10. When typing a snippet eg I type zcod I get 3 suggestions - but the top one is a merge replication conflict table definition for MSmergeConflictZZZFULLZZZcodt and the 2 below it are my own snippets starting with zcod
    I don't understand why this is the case, my own suggestions that START with zcod should take precedence over an is
    ms_shipped table that ends in zcod surely.
    I see you recently added (I am on 9.5.11) ordering based on frequency and I never click this table as it serves no purpose so I cannot understand the behaviour.

    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

    1 comment  ·  Intellisense  ·  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. Options, Warnings & Highlighting, Highlighting. The light gray does not work well on a black background. I'd like to be able to select another color for that feature.

    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

    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 concatenating strings, it'd be nice to be able to align the "+" sign. The following is what I get now:
    SELECT CASE
    WHEN Col = 1
    THEN 'Col 1'
    ELSE ''
    END + CASE
    WHEN Col = 2
    THEN 'Col 2'
    ELSE ''
    END + CASE
    WHEN Col = 3
    THEN 'Col 3'
    ELSE ''
    END + CASE
    WHEN Col = 4
    THEN 'Col 4'
    ELSE ''
    END AS ConcatStr
    FROM #Test;

    But what I'd like to get is:

    SELECT CASE
    WHEN Col = 1
    THEN 'Col 1'
    ELSE ''
    END
    + CASE
    WHEN Col = 2
    THEN 'Col…

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  13. Currently Code Analysis does not implement all of the items that Find Unused Variables and Parameters does.

    Specifically I know it's missing:
    - Declared variables that are used before a value is assigned
    - Assigned values that are never used

    Ex.
    With this code:

    DECLARE @Test NVARCHAR(1)
    DECLARE @Test2 INT
    DECLARE @Test3 DATE

    SET @Test = 1

    SET @Test = N'Test' + @Test2

    Code Analysis will flag the DECLARE for @Test for having a NVARCHAR of size 1 and @Test3 for not being used, but it will not flag @Test2 for being used before a value is assigned to it…

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  14. Currently SQL Prompt only has one option for formatting insert statements which poses a problem for us with multi value set inserts.

    Ideally we'd be able to select a formatting for a single value set insert and another format for a multi value set insert.

    This would allow us to do something like this:

    -- Single Value Set Insert
    INSERT INTO TestTable (TestName,
    ~~~~TestValue,
    ~~~~TestDate)
    VALUES (N'Something',
    ~~~~140,
    ~~~~'1/1/2019')

    -- Multi Value Set Insert
    INSERT INTO TestTable (TestName, TestValue, TestDate)
    VALUES (N'Something', 140, '1/1/1900'),
    ~~~~(N'SomethingElse', 150, '1/2/1900'),
    ~~~~(N'SomethingElse2', 160, '1/2/2000')

    The issue for us is that we have need of…

    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

    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)
  15. I would like to control the list behavior on a clause by clause basis so that I can separate the formatting on my DECLARE statements differently than lists within SELECT and INSERT statements. As it stands, these are conflicting changes. So, the only way to get each variable declared on a separate line is to also have every column in other statements on a separate line. I'd like to be able to do BOTH of these:

    DECLARE @GUID UNIQUEIDENTIFIER = NEWID(),
    @Char CHAR(1) = 'A',
    @Int INT = 1,
    @Datetime DATETIME = CURRENTTIMESTAMP,
    @Decimal DECIMAL(18,10) = 1.0,
    @Date DATE

    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 →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  16. I write a LOT of unit tests, usually at the rate of 15:1 to 20:1 to my executing code. I have these standardized and templated to make them easier and more consistent to build. e.g. @GUID UNIQUEIDENTIFIER = NEWID(),
    @Char CHAR(1) = 'A',
    @Int INT = 1,
    @Datetime DATETIME = CURRENTTIMESTAMP,
    @Decimal DECIMAL(18,10) = 1.0,
    @Date DATE = CURRENT
    TIMESTAMP,
    @Time TIME = CURRENT_TIMESTAMP,
    @Bit BIT = 1,
    @Money MONEY = 1.00,
    @Binary VARBINARY(18) = 0x01,

    These go into my VALUES clause for INSERT statements, but I current have to do all of this manually, which takes a LOT…

    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

    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)
  17. Currently I have query tabs in two separate windows within SSMS to view data and queries side by side. After closing and re-opening, it would be great if these segregated tabs went back into their appropriate windows. Along with that, it would be great if it would only load back in the tabs for the server we are connected too. Not also the tabs that I had open in a different instance of SSMS to a different server; which I had displayed on a different monitor for more side by side viewing.

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  18. 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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  19. Similar to the query shortcuts built into SSMS with the number row...except you can set it on-the-fly, quickly and easily.

    I'll let you guys figure out the details if you think it's a good idea. Basically I want the ability to give SQL prompt a query, and say, "please run this every time before running the highlighted query". But the configuration process needs to be FAST and EASY to help with rapid troubleshooting.

    This is useful for variable declarations that are at the top of a script, but you need to run another part of a script separately.

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  20. I have some snippets that I would like to be server specific. For example, we have two servers, each one has a sort of "support" database, but they do not have the same database name. But both databases have maintenance procs I like to use that do have the same name.

    I'd like to have some way of saying "If I am on Server1, then run SnippetA, if I am on Server2 then run SnippetB"

    OR

    Allow something like this as part of the snippet:

    $IF($SERVER$='Server1','String1','String2')$

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  • Don't see your idea?