22 results found
-
Add comment with style used etc when code is formated
Add some metadata as comment on when the code was formatted and which style was used, the user etc. This would make it possible to find unformated code with simple text searches
1 voteHi Fredrik,
Thanks for the suggestion. The team reviewed it today, and our preferred implementation would be bulk actions for formatting. A similar suggestion for this already exists here:
https://redgate.uservoice.com/forums/94413/suggestions/8196585
We’ll be reviewing batch operations for Prompt later in the year so do subscribe to that suggestion to keep updated.
Tim
-
Be able to add space between two right parentheses
When I have two right parentheses next to each other like in a query like this (in the OPTION clause)
SELECT Columns
FROM TableA
INNER JOIN TableB
ON TableA.Key = TableB.Key
OPTION( USE HINT( N'FORCEDEFAULTCARDINALITY_ESTIMATION' ) )There doesn't appear to be an option to have the space between the two right parentheses at the end. I have tried checking/unchecking quite a few boxes in the formatting style editor, and I don't think anything is controlling this. To me, the "add spaces around parentheses contents" option should put a space between the two right parentheses, but it doesn't.
12 votesHi Jake,
Thanks for reporting this. The team have reviewed the suggestion and we think it’s a bug rather than a feature suggestion.
If you’d like to submit this as a ticket into our support team we’ll pick it up from there and action.
-
Remove redundant parentheses
I sometimes get code that looks like this:
WHERE (a = b) AND (c = d) AND (e = f)Or even like this:
WHERE (((a = b) AND (c = d)) AND (e = f))It would be great if SQL Prompt would have an option to remove all the redundant parentheses and reduce this to
WHERE a = b AND c = d AND e = fOf course it would have to be smart enough to not remove parentheses that are needed when mixing AND and OR. So if I submit this code:
WHERE ((a = b)…5 votesThank you for your suggestion.
We’ve reviewed this as part of our UserVoice triage.
Currently, we have no plans to implement this feature in the near future.
Kind Regards,
The Prompt Team -
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
3 votesWe currently are not planning on doing this at this time, unless there is a significant increase in demand.
Thanks for your suggestion,
The Prompt Team -
Comments are formatted wrong
SQL Prompt 7.3.0.437 will format the following
/*******************************************************************************
troubleshooting queries - query_hash and query_plan_hash
********************************************************************************/
/*
query_hash Binary hash value calculated on the query and used to identify queries with similar logic. You can use the query hash to determine the aggregate resource usage for queries that differ only by literal values.
*/
like this: (too many empty lines added with Whitespace / Preserve existing new lines between statements)
/*******************************************************************************
troubleshooting queries - query_hash and query_plan_hash
********************************************************************************/
/*
…query_hash Binary hash value calculated on the query and used to identify queries with similar logic. You can use the query hash
1 voteHi Torsten,
Unfortunately it looks like UserVoice has stripped out all of the formatting from your request. Would you be able to post it again on our support forum https://forums.red-gate.com/viewforum.php?f=169
Thanks,
Aaron. -
Allow Format SQL to execute even when there are errors
If I'm halfway through writing a query and I want SQL prompt to format it in order to make it easier to finish what I'm doing, SQL prompt currently will fail because the query's not syntactically correct.
What I'd like is an option where I can tell SQL prompt I don't care if the queries I'm formatting are incorrect, just do your best with it and ignore any errors.
44 votesUnfortunately the way SQL Prompt parses SQL code currently does not allow for formatting when there are errors in the code.
Changing this would be a very large project because extensive changes to the parser would be required.
We are not planning on doing this at this time.
Thanks for your suggestion,
The Prompt Team -
Implement Collapsable Regions
Developing a script of some size becomes very tedious when going back and forth, and the script quickly becomes unwieldy.
Add collapsable regions driven by specially formatted comment (--#Region [name/description/comment] ... --#EndRegion, or some other suitable notation).
70 votesWe’ve had a look at this feature and found a potential existing solution using
BEGIN END blocks in SSMS 2016+e.g.
BEGIN —this is a “region”
SELECT * FROM TEST;END
We’re not planning to do this in the near future because of the effort required to support all versions of VS and SSMS that Prompt is available on.
Kind Regards,
Prompt Team -
Format CTEs to keep the semicolon on the same line as the "With"
When you format:
SELECT x from y
;WITH NumberSequence ( MonthNumber )
AS ( SELECT 1 AS MonthNumber
UNION ALL
SELECT MonthNumber + 1
FROM NumberSequence
WHERE MonthNumber < 12
)You move the semicolon to the end of the previous command instead of leaving it with the CTE and remove the blank line:
SELECT x from y;
WITH NumberSequence ( MonthNumber )
AS ( SELECT 1 AS MonthNumber
UNION ALL
SELECT MonthNumber + 1
FROM NumberSequence
WHERE MonthNumber < 12
)Should leave the blank line and semicolon where they are.
Thanks,
Tom
20 votesThank you for your suggestion.
We’ve reviewed this as part of our UserVoice triage.
We’ve decided not to implement this feature as there is not enough evidence/demand at this point in time to justify its implementation.
Kind Regards,
The Prompt Team -
Format SQL suggestions (first impression from week 1 of 15-day trial)
I'd like the ability to align my parenthesis with the start of the line above it like so:
SELECT
column1
,column2
,column3
FROM
table1
WHERE
tableID IN
(
1
,2
,3
)I would also like the option to never insert more than 1 space between words in a line.
I don't like that there is a full tab between WITH and TARGET below. TAB the whole line or nothing. I can't find a way to get rid of this.
;
WITH TARGET
AS (
SELECT
Column1
,Column2
,Column3
FROM
table1
)A keyboard shortcut to add commas to a…
2 votesStephen,
I’m so sorry about the UserVoice formatting issues. I’m going to contact their support to see if this can be fixed. For now, can you please post this in our support forum at http://www.red-gate.com/messageboard/viewforum.php?f=137.
Davin,
I’ve declined this suggestion because it contains too many suggestions. Please post each suggestion separately so other users can vote on individual suggestions, which will help us prioritize work. There are some really good ideas here and we appreciate the feedback.
-
Need for automatic "where" concatenation
When you are working with SQL it is easy to forget the "where" statement in update, delete. If this happens in production it could be devastating. It would be a nice feature to automatic add the "where" statement in for "delete" and/or "update".
19 votesThank you for the suggestion.
Prompt already provides execution warnings when you use an UPDATE or DELETE statement without a WHERE clause and code analysis also flags this as an issue. Please see the comments below for other options for solving this issue.
You can get the latest version of SQL Prompt, including all of the above, from http://www.red-gate.com/products/sql-development/sql-prompt/.
Thank you for your help!
Kind regards,
The Prompt Team
-
My coding preference is to place commas at the beginning of a line, NOT the end. Can you make the placement a config option?
My coding preference is to place commas at the beginning of a line, NOT the end. Can you make the placement a config option?
If you would like I can explain why this is much better than having them at the end of the line.
5 votesI’m declining this suggestion as we already have this option under Format→Commas & parentheses.
-
Feature request: Remove "AS" clauses from Group By lines...
I use many "as" clauses in my selects. If I need to use a Group By clause, I can copy my Select items, but then I have to manually remove all of the "AS" clauses. It would be a dream to have them removed during a format!
Also, what would be involved in having a "change to other favorite connection" mechanism, so I can switch my current query between production, development and test? And it would be doubly sweet if the switch also changed to my usual db on that instance. Like an Alt-Tab allows you to switch between open…
5 votesThank you for your suggestion.
Ideally, we’d love to respond individually to every request, but currently we can’t due to the volume of unanswered tickets. We’re clearing up our UserVoice backlog to make it easier for us as a small team to prioritize the most valuable features moving forward. Therefore, due to a lack of recent interest in this ticket, we have decided to close it.
If you feel strongly about it, we encourage you to create a new request.
Thanks,
The Prompt Team
-
Option to add WITH (NOLOCK)
I would like SQL Prompt to be able to insert WITH (NOLOCK) when writing SELECT and JOIN statements. When working with production data, the risk of forgetting to write this chunk and locking data rows is very high.
57 votesThanks for all the feedback here.
After review, the team have decided to decline this specific suggestion. But, we’ll take forward Kendra’s code analysis suggestion in the comments below.
-
Format MDX
It would be great to format MDX queries
48 votesAfter reviewing this suggestion the team don’t feel this will be high enough on our priority list to keep open.
MDX Studio looks like the answer for anybody looking for an editor.
-
Automatically run "Format SQL" on code returned from "Design Query In Editor"
Since "Design Query in Editor" results are totally unformatted, how about an option to automatically format the code returned.
2 votesThank you for your suggestion.
Ideally, we’d love to respond individually to every request, but currently we can’t due to the volume of unanswered tickets. We’re clearing up our UserVoice backlog to make it easier for us as a small team to prioritize the most valuable features moving forward. Therefore, due to a lack of recent interest in this ticket, we have decided to close it.
If you feel strongly about it, we encourage you to create a new request.
Thanks,
The Prompt Team
-
Make snippets follow case formatting
I have my (personal preference) format case set to lowercase for reserved keywords, built-in functions and built-in data types. When I use snippets however, the case remains the same as the snippet was original setup - would be nice if the snippets followed the same rules as the auto-complete
7 votesThank you for your suggestion.
Ideally, we’d love to respond individually to every request, but currently we can’t due to the volume of unanswered tickets. We’re clearing up our UserVoice backlog to make it easier for us as a small team to prioritize the most valuable features moving forward. Therefore, due to a lack of recent interest in this ticket, we have decided to close it.
If you feel strongly about it, we encourage you to create a new request.
Thanks,
The Prompt Team
-
Format select to one line
I would like an option to format select to one line. And make it so that you can save multiple option sets for formatting preferences.
For example ordinarily a mult line select is good. However in some situations such as copying select statements into a text box it needs to be formatted to be on one line.
Being able to define mulitple option sets and creating an option to keep select on one line would resolve the issue.
2 votesWe’ve released a new formatting engine in SQL Prompt Version 8.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
If there is something missing please let us know by opening a new suggestion.
Kind regards,
The Prompt Team
-
Sort Selected Text
Sorts selected lines. Nothing fancy, but incredibly useful.
5 votesThank you for your suggestion.
Ideally, we’d love to respond individually to every request, but currently we can’t due to the volume of unanswered tickets. We’re clearing up our UserVoice backlog to make it easier for us as a small team to prioritize the most valuable features moving forward. Therefore, due to a lack of recent interest in this ticket, we have decided to close it.
If you feel strongly about it, we encourage you to create a new request.
Thanks,
The Prompt Team
-
Format option for short selects to stay on one line
When a SELECT statement is short, for example fits on one line on my screen I would like for the SELECT to not be formatted onto multiple lines. This could even apply to the parts of the SELECT if the entire SELECT statement is long. For example a WHERE statement with only two short clauses could be one line.
13 votesWe’ve released a new formatting engine in SQLPrompt Version 8.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
If there is something missing please let us know by opening a new suggestion.
Kind regards,
The Prompt Team
-
Format option for no new line after SELECT *
A new Format->Data Statement option for when SELECT * FROM is used that keeps it on the SELECT and FROM on the same line.
2 votesWe’ve released a new formatting engine in SQLPrompt Version 8.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
If there is something missing please let us know by opening a new suggestion.
Kind regards,
The Prompt Team
- Don't see your idea?