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

637 results found

  1. Currently the behavior for inserting a full INSERT statement is that it produces something like this:

    INSERT INTO dbo.ContactPictures
    ( InterActionPersonalContactID ,
    InterActionFirmContactID ,
    ImageFileStoreFilePathSegment ,
    Source ,
    ManuallyCreatedByUserAccountName ,
    DateTimeLastUpdated
    )
    VALUES ( 0 , -- InterActionPersonalContactID - int
    0 , -- InterActionFirmContactID - int
    '' , -- ImageFileStoreFilePathSegment - varchar(256)
    '' , -- Source - varchar(20)
    N'' , -- ManuallyCreatedByUserAccountName - nvarchar(40)
    GETDATE() -- DateTimeLastUpdated - datetime
    )

    Hard-coded values are rarely what's needed, though; it would be very useful if it could generate variables and use them in the statement, like this:

    DECLARE @InterActionPersonalContactID INT = 0…

    8 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)
  2. EXEC spwho2 without return (EXEC @Results = spwho2)
    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

    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)
  3. I don't use SQL Prompt in Visual Studio and likely never will. However, every time I update, the updater defaults to installing it for VS and updating SSMS. It would be nice if the update process defaulted to only doing updates.

    7 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. Add rule for deprecated DATABASEPROPERTY

    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)
  5. My default preference is to maintain the ON keyword without a new line. I would like to be able to CONDITIONALLY place the ON keyword on a new line if, and only if the ON keyword together with the associated ON condition exceed a configurable wrap threshold.

    Example:
    -- Yield this >>>>
    SELECT *
    FROM Person.Address
    INNER JOIN Person.StateProvince
    ON StateProvince.StateProvinceID=Address.StateProvinceID
    -- >>>> instead of

    SELECT *
    FROM Person.Address
    INNER JOIN Person.StateProvince ON StateProvince.StateProvinceID=Address.StateProvinceID
    -- Assuming the JOIN clause exceeds the wrap length
    -- <<<

    This is particularly useful if the "Place JOIN table on new line" is NOT selected…

    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)
  6. Similar to the CTE request https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/19545028-format-cte-closing-parenthesis

    Aligning the closing parenthesis on its own line, in the same column as the opening paren, makes the subquery stand out, as well as making the alias stand out.

    9 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. if blah=1
    ____return 1;

    if blah=2
    _begin
    _
    return 2;
    _end
    else
    _
    return 0;

    12 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

    2 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. Arithmetical expressions and compound logical expressions all consist of operations and expressions with parentheses and orders of precedence. All of these should have the options for aligning operands, aligning parentheses, adding parentheses to make the default orders of precedence explicit. All expressions are subordinate to clauses so they should be indented under WHERE, ON, SELECT, WHEN.

    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)
  9. It would be nice if the IN clause were formatted like a logical function that returns a value so that it followed the options and rules for parentheses and were indented according to its place in the logical expression. (paying attention to the ANDs and ORs if present)

    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)
  10. 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…

    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)
  11. 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,…

    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

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  12. Stop raising EI028 when adding columns using style:

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

    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)
  13. At the moment a warning is given "Non-scalar subquery in place of a scalar" when trying to assign a variable to the result of a MIN or MAX query which would only result in a single value. Also get the warning when i create a Scalar valued function and assign variable to result of a call to that. In each of these case only one result can be returned so the warning appears inaccurate and wrapping the result in a TOP 1 { } ORDER BY statement seems an overkill just to remove the warning

    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)
  14. It would be cool if SQL Prompt was able to remove trailing whitespaces/tabs not only for T-SQL, but also for comments.

    It's not something crucial, but rather nice-to-have

    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)
  15. 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

    8 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)
  16. Add option to leave semicolon on same line if statement only use one line.

    My idea is an additional to the idea captured in the "semi colon placed on new line" request.

    It would be nice to have checkbox for the semicolon-on-new-line option to not move the semicolon to a new line if the statement is ONLY one line.

    For example:
    SELECT TOP 10 * FROM dbo.Table
    ;
    should be
    SELECT TOP 10 * FROM dbo.Table;
    instead, but
    SELECT TOP 10 *
    FROM dbo.Table
    ;
    will remain unchanged by formatting.

    9 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)
  17. I am in the process of converting many Stored Procedures to UDFs (for various reasons).

    One thing that is irritating is that these SPs often use the SELECT x, y, z INTO #tempTable pattern.

    Would that be possible for you to generate the equivalent DECLARE @tempTable TABLE ( x TYPE,y TYPE,z TYPE) statement?

    That would have proven to be very helpful!

    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. Hi,

    it would be extremely useful to allow the user to disable a code analysis rule for specific cases and not just on a global scope.

    E.g.
    cast(cast(0 as binary) pops up the issue BP008 (CAST/CONVERT to var types without length) which my be correct for certain cases but not always.

    It would be very hand if I could tell the analyzer to not give any warning for this single line, perhaps by adding a pseudo comment like --##BP008 or similar.

    This comment would temporarily disable the warning for this single line/case but not for the rest of a script.

    15 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. Microsoft SQL Operations Studio is in preview mode and shows a lot of potential. I would probably switch from SSMS right now if SQL Prompt was supported. Please add SQL Prompt!

    292 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)

    SQL Prompt for Azure Data Studio is now in public preview!

    The aim of this public preview is to learn from the ADS community about how SQL Prompt can enhance your developer experience, adding improvements and new features based on your feedback.

    With SQL Prompt, you can use an extensive collection of code snippets to write your SQL code quickly and efficiently. You can also keep your code consistent using the powerful formatting capability, with the ability to customise the applied style to suit your preferences.

    We’d love to hear your feedback. You can get in touch with the team either via the new SQL Prompt in ADS forum: https://forum.red-gate.com/categories/sql-prompt-in-ads or email us at sqlprompt.in.ads@red-gate.com.

    Get started with SQL Prompt for Azure Data Studio now. Download it here: https://download.red-gate.com/EAP/SQLPromptADS.zip

  20. In SQL Prompt 8, multiple-line comment blocks (surrounded by /* */) are automatically indented to the SQL code surrounding them when formatting.

    Can you please add an option to preserve the indentation of these blocks? My team keeps most comment blocks left-aligned for consistency and readability, but SQL Prompt will automatically move them when formatting.

    This was not an issue in SQL Prompt 7, so all of our comment blocks are now moving when upgrading to SQL Prompt 8 and there is no option to preserve them. Thank you.

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