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 https://forum.red-gate.com/categories/sql-prompt

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. Allow custom rules for code analysis

    SQL Prompt has the ability to catch and warn about Update statements without Where clauses.

    How about something similar that catches and warns about security commands like Grant or Deny.

    1 vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
    • Support SQL Prompt in Visual Studio Code Review

      When doing code reviews in Visual Studio Team Explorer, I want to be able to use SQL Prompt's Code Analysis to check the pull request or shelf set. At the moment that doesn't work, according to the SQL Prompt Dev team as of 27 Sep 2018:

      Tianjiao Li (Support)
      Sep 27, 15:26 BST

      "Our development team has confirmed we do not currently support the Code Review feature in Visual Studio. SQL Prompt is not aware of this tab, so defaults to showing issues for the last SQL file it recognized. Whilst this behavior might seem a little strange, Code Review…

      1 vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)

        We’ll send you updates on this idea

        1 comment  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
      • Spell check & Normalize variables, alias and column names

        I, and I suspect many others, spend waaayyy too much time ensuring new column names, variables and aliases conform to a standard and are at least spelled correctly.

        Recently I named a bunch of new table columns with the word "brokerred" in them. Whoops, the correct spelling is "brokered". I won't leave that mess in there and had to go back and clean up a bunch of code.

        Also, include a list of allowed abbreviations. i.e. Qty for Quantity and flag when the full word is used instead of the abbreviations. Having both "QtyReleased" and "QuantityReleased" sprinkled around an application…

        2 votes
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          Signed in as (Sign out)

          We’ll send you updates on this idea

          0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
        • DECIMAL default scale warning in Code Analysis

          Would be great if SQL Prompt Code Analysis would give a warning on SQL Below:

          SELECT CAST( 1.453 AS DECIMAL)
          SELECT CONVERT(DECIMAL, 1.453 )

          1 vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
          • FORMATMESSAGE param_value check

            This may be impossible when msg_string is a variable, when specifyin a specific value it would be nice if the number of parameters passed matches the number of parameters requested. In the following example, I'm passing two values (@var1 and @var2) but msg_string is only expecting one (%s).

            SET @error_message = FORMATMESSAGE('%s - ERROR: RBC IS NULL', @var1, @var2);

            1 vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              Signed in as (Sign out)

              We’ll send you updates on this idea

              0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
            • SQL Query Result Change Status

              SQL Query Result Change Status

              Whenever the results of the query change user should get notified only for that query/script/snippet etc.

              Sometimes I do not want to keep running the same query after every few seconds to check if the results have been changed.

              thanks

              1 vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
              • Issue a warning when columnname = null

                Every once in a while I do something dumb in my where clause. Something like where customername = null

                Of course, the correct thing to do is customerName is null because customerName = null will never be true. Still I make this mistake on occasion and it takes me a few minutes to realize and correct it to Is null.

                Anyway, I think if you add this to sql prompt that would be helpful.
                Thanks,
                Ben

                3 votes
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                • EXEC sp without return (EXEC @Results = sp)

                  EXEC sp_who2 without return (EXEC @Results = sp_who2)
                  Give a warning when tsql or stored procedure has execute a stored procedure without a variable for an error to bubble up to.

                  This is the proper way because ieven in a try catch the Exec sp_who2 won't give and error to stop the tsql from going on

                  2 votes
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                  • Add rule for deprecated DATABASEPROPERTY

                    Add rule for deprecated DATABASEPROPERTY

                    2 votes
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                    • Show parameters names and their types when hit ctrl+space inside the brackets

                      Let's take following example.
                      SELECT * from dbo.some_function()

                      If I hit ctrl+space when my cursor is here:
                      SELECT * FROM dbo.some_function$CURSOR$() then I am getting function definition and that's OK.

                      If I hit ctrl+space here:
                      SELECT * FROM dbo.some_funnction($CURSOR$) I am getting nothing useful. I suggest to show what are the parameters for that function with their data types.

                      2 votes
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                      • Make code analysis compatible with tSQLt

                        It would be nice if the code analysis module had intelligence to suppress rules wrt to unit tests. For example, ST011 should not be flagged when you see temp tables inside a unit test. This is because AssertEqualsTable and AssertEmpty table have no capability to deal with table variables and instead have to use temp tables. Wrt to unit tests, it's a false positive. You are left with 2 choices:
                        1. Turn the rule off and have it not flag anything - unit test or otherwise
                        2. Leave it on, ignore it, and fall into the habit of ignoring every…

                        1 vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                        • Offline TSQL code analysis and Standardization report..Where we can add custom rules regarding to company naming procedure

                          My Name is Waleed Abrar and my license number is. I am actively looking of Static TSQL Analysis and I was really happy with the SQL Prompt. I have done some analysis and implemented some test cases. It works really good working live and parallel to development . I want to ask if it’s possible to do an offline analysis and get a HTML or Excel report for a particular database about the TSQL code Quality inside the DB. For Example I can select the Database ‘XYZ’ and then click Analyze static code. It will give me a report back…

                          1 vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                          • SC003 USE statement in batch

                            SC003 is highlighting and saying there is a problem that I have a USE statement in a batch. Um.....how in the heck do you propose to point a script to the appropriate database WITHOUT a USE statement. Last time I checked, the command to change database context was USE and anyone writing scripts and wanting to make sure they are run against the appropriate database will ALWAYS put a USE statement in a batch script.

                            2 votes
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              1 comment  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                            • Inconsistently Advised to Use Alias For CTE (ST010)

                              Simple statements do not flag this:

                              WITH CTE1 AS (SELECT TestColumn FROM dbo.TestTable)
                              SELECT a.TestColumn FROM CTE1 a
                              INNER JOIN CTE1 b ON a.TestColumn = b.TestColumn;

                              However, more complex statements do:

                              WITH CTE1 AS (SELECT TestColumn FROM dbo.TestTable),
                              CTE2 AS (SELECT TestColumn FROM CTE1),
                              CTE3 AS (SELECT TestColumn FROM CTE2)
                              SELECT CTE3.TestColumn FROM CTE3
                              INNER JOIN CTE2 ON CTE3.TestColumn = CTE2.TestColumn;

                              In the final select clause, both CTE2 and CTE3 are flagged with 'Use alias for all table sources' (ST010).

                              Seems a bit OTT to suggest references to CTEs are aliased? I accept that a CTE defines, in relational terms,…

                              3 votes
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                              • Code Analysis EI028 Incorrectly Identified When Adding Not Null Column With Explicitly Defined Default Value

                                Stop raising EI028 when adding columns using style:

                                ALTER TABLE dbo.MyTable
                                ADD TestColumnB CHAR(1) NOT NULL,
                                CONSTRAINT DF_MyTable_TestColumnB DEFAULT ('B')
                                FOR TestColumnB;

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                                • Code Analysis conflicts with Intellisense

                                  Some code analysis rules conflict with the way IntelliSense is inserting code. That is frustrating. Example three and four part identifiers are deprecated. But I did not type those. They were inserted automatically.

                                  1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Give hint if the database name is written in a stored procedure or function.

                                    Some developers may write the database name inside stored procedures or functions. I recommend that SQL Prompt should give a hint of this.

                                    4 votes
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Ability to code analyse existing database (SPs, triggers, etc.)

                                      SQL Prompt provides the ability to improve your on-the-fly coding according to standards and best practices defined locally or within the organisation.

                                      How about the ability to analyse an existing database and isolate problematic areas, code smells and provide not only recommendations but also the ability to refactor the database code based on rule-sets?

                                      This would be really great and a time-saver to improve the code quality in the whole database.

                                      Thanks, Jochen Kirstätter, MVP

                                      5 votes
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        0 comments  ·  Code Analysis  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Don't see your idea?

                                      Feedback and Knowledge Base