184 results found
-
Option to align AND conditions with ON clause
Would love to have the option to have all conditions (AND / OR) aligned (or same indentation) with the ON clause, for example:
FROM dbo.orders AS o
JOIN dbo.orderAttributes AS oa
~~ON oa.companyID = o.companyID
~~AND oa.orderID = o.orderID5 votes -
Separate ALIAS Alignment - table vs. column
Aligning based on column-alias makes for much better readability. When turned OFF, because some long-named table's alias pushes the TABLE-alias way to the right, all other table aliases follow it...into the NON-VISIBLE area (when using multiple vertical tabs).
Please SEPARATE these into TWO options:
. Align Column Aliases - on/off
. Align Table Aliases - on/offTHERE IS A BUG TO FIX HERE TOO: If a UDF is bounded by "--SQL Prompt formatting off/on" the TABLE ALIAS position REMAINS as if the UDF's alias was in it's SQL Prompt position, NOT where the excluded code has it! NASTY.
You could…
5 votes -
Copy as IN clause - Allow second column as ID comment
So… Copy as IN Clause. Love it, but let’s improve it. Let’s say we have the following output…
ProductID ProductDesc
1 SQL Prompt
2 SQL Search
3 SQL CompareIf we use Copy as IN Clause on the ProductID column, we get:
IN
(
1,
2,
3
)Which super…. However those IDs mean nothing to me in 6 months time when I’m now having to modify my code. What would be awesome, is if I can select both ProductID and ProductDesc, then hit Copy as IN Clause, and get the following output:
IN
(
1, -- SQL Prompt
2,…5 votes -
untabify
When saving/opening file automatically untabify it.
(select all then edit|advanced|untabify selected lines)
Some how, some way, despite telling everyone to set convert tabs to spaces we constantly get tabs in our SQL code. It would be really nice to just have it automatically convert to spaces so I can save a few clicks.
5 votes -
Import and Export Aliases
It would be nice to have the ability to mass import/export aliases.
5 votes -
Shortcut to move commas from start to end and vice versa.
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 -
format Window functions
SQL Prompt fails badly in formatting window functions. As these are present at least since SQL 2014, SQL Prompt should be able to interpret them and format them accordingly.
Example:
I would format the LAG() function as follows:
SELECT
myColumn AS realColumn
,LAG(myColumn, 1, 0)
OVER (
PARTITION BY someColumn
ORDER BY anotherColumn) AS calculatedColumnTry this with SQL Prompt - it's result is not very nice...
5 votes -
Comment in /* */
Is it possible to add a hard return after the /* comment */ block so code doesn't keep formatting after the comment
Currently:
/* comment */ UPDATE User
SET Modified = CAST('2018-12-20' AS datetime)
WHERE id = 255454Suggestion
/* comment */
UPDATE USER
SET Modified = CAST('2018-12-20' AS datetime)
WHERE id = 2554545 votes -
Format of Valid Selected Code when there is invalid code in the script (Take 2)
Version 9.2.5.6073
I would like to request that script validation be limited to the selected text during Format SQL.This is a duplicate of a Completed feature (Bug) submitted on version 7. https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/16611622-formatting-of-valid-selected-code-when-there-is-in
I see recent comments on the original request but you may not be addressing since it is marked completed.To Replicate:
Put 3 lines below in a new Window in SSMSSOME BAD TEXT
GO
SELECT 1 FROM dbo.PersonNow select All of Line 3 after the GO Statement. Right-click, Format SQL
Should get following error:
"Error inserting semicolons" ...
Script parsing errors:
Line 1 Col: 1…5 votes -
IF Statement block formatting is messed up
IF Statement block formatting is messed up
IF 1 = 1
BEGIN
PRINT 'DO STUFF'
ENDbecomes
IF 1 = 1 BEGIN
PRINT 'DO STUFF';
END;which is what I want...I want to leave the BEGIN END indention
5 votes -
Empty Line Before and After Multi-Line Statements
Complex multi-line statements are much easier to read when separated by an empty line above and below them. Please add an option to turn on "Empty Line Above/Below Multi-Line Statements".
5 votes -
Format on Save
Allow an option when saving / running a file that you format the sql to the format selected. Will make sure the whole team follow the standards and does not forget to run the formatter.
4 votes -
Allow SQL PROMPT to resolve constants in an ORDER BY clause
If I create a query with an ORDER BY clause such as ORDER BY 1, 2; SQL Prompt will flag the ORDER BY and report ORDER BY clause with constants.
It would be nice to have an option to have SQL Prompt replace the constant(s) with the correct column names.
4 votes -
Align SET statements around = sign
I am a brand new user (1 day) for SQL PROMPT. I managed to get my parameter statements to align, but there is no option on my custom formatting style to align my set statements. See the attached jpg. Trying to get it to look like the yellow highlighted area.
4 votes -
Moving commas INDEPENDENTLY between front and end (for debugging mainly)
DAX Studio has a splendid feature that I think is missing from SQL Prompt and could be rather easily implemented. In DAX Studio one can switch with one mouse click between putting commas before or after the column names. The "before" option greatly speeds up debugging but such formatting should not be left in production. In prod we want to have commas after the column name. Would it be possible to add a quick action or option to SQL Prompt so that commas are immediately placed at the end or beginning of column names? I know there are formatting styles…
4 votes -
Place space before END when collapsing shorter case statements
When collapsing CASE expressions shorter then XXX, the END has no space if there is a preceding parenthesis.
Example1 = CASE t1.Col004 WHEN 1 THEN t1.Col006 END,
Example1 = CASE t1.Col004 WHEN 1 THEN TRY_CONVERT(int, t1.Col006)END4 votes -
Parentheses positioning not honoured for all parentheses, eg constraints
Using the parentheses option "expanded, to statement" for DDL, I would expect a constraint to appear with the opening parenthesis under the start of the constraint (eg, the "f" in a foreign key constraint) as follows:
MyColumn int not null foreign key references SomeTable ( someColumn )
But it actually appears at the end of the same line as the constraint, and the entire contents are indented from that position:
MyColumn int not null foreign key references SomeTable( someColulmn )
4 votes -
flip between adding and removing square brackets
Add ability to add or remove square brackets without having to edit the settings for which direction you want it to go.
4 votes -
format setting for "Copy as IN clause"
when I paste after "Copy as In clause", got contents like this:
IN
(
1, --comma at behind
2
)I hope got this:
IN
(
1
,2 --comma at before
)please provide option, thanks.
4 votes -
Add one additional Parenthesis style
My Teams would prefer this option:
xxxxxxxxxxxxxx (
xxxxxxx,
xxxxxxx )Opening parenthesis on the first line, and closing parenthesis on the last line.
Second and following lines indented one stop. This display seems to strip out the leading spaces.
4 votes
- Don't see your idea?