187 results found
-
Align column aliases, but only up to a configurable MAX point
The alias alignment is a nice feature that improves the readability of the formatted SQL. Still, it sometimes gets lost too far to the right when the selected column values include things like SQL functions and column names. In those cases, the alignment of the column aliases can require scrolling to the right to see them with a great amount of whitespace between the column name and the aliases and they thus become a detriment to the readability of the SQL.
It would be great if we could configure a max number of spaces to align the aliases before which…
1 vote -
sub
I would like to be able to check a box and always indent a sub-query.
currently formatting a query works like this:
SELECT *
FROM dbo.tbl1 AS a
INNER JOIN(SELECT ID FROM dbo.tbl2 WHERE value = 'y') AS b ON a.id = b.idwhen the paren is set to inline the open paren and indent the content with the indent parentheses contents checked. I would rather have a checkbox to force the sub-query to format like this:
SELECT *
FROM dbo.tbl1 AS a
INNER JOIN (
SELECT ID
FROM dbo.tbl2
WHERE value = 'y'
) AS b ON a.id =…1 vote -
Option to display values within IN statements without spaces between them
Another white space removal feature to suggest.
The ability to format all IN statements as:
empType IN ('a','b','c','d')Rather than the default:
empType IN ('a', 'b', 'c', 'd')I have done some exploring in the formatting styles and scouring the forums here and this feature doesn't seem to be available.
1 vote -
Allow indentation similar to nested JOIN when they are not written as nested
A nested join is indented additionally relative to the join that it is nested within:
SELECT *
FROM Person.Address
--INNER JOIN Person.StateProvince
----INNER JOIN Sales.SalesTerritory
------ON SalesTerritory.TerritoryID = StateProvince.TerritoryID
----ON StateProvince.StateProvinceID = Address.StateProvinceIDWhen joining the same tables but not writing them in a nested manner, there is no additional indentation:
SELECT *
FROM Person.Address
--INNER JOIN Person.StateProvince
----ON StateProvince.StateProvinceID = Address.StateProvinceID
--INNER JOIN Sales.SalesTerritory
----ON SalesTerritory.TerritoryID = StateProvince.TerritoryIDIt would be nice to allow the same amount of indentation that would be used if the join were nested to be used when it is not nested:
SELECT *
FROM…1 vote -
Separate VALUES style by first/subsequent
It would be nice to have an option to specify different styles when there is one set of VALUES compared to multiple. For example, I would like to use "Compact, indented) when there are multiple sets of VALUES:
INSERT INTO Employees
( id
, FirstName
, LastName
, BirthDate )
VALUES
( 2
, 'Jane'
, 'Doe'
, GETDATE())
, ( 3
, 'Frederico'
, 'James'
, GETDATE());But compact when there is only one set of VALUES:
INSERT INTO Employees
( id
, FirstName
, LastName
, BirthDate )
VALUES
( 2
, 'Jane'
, 'Doe'
, GETDATE())1 vote -
CTE on new line with commas before items is adding an extra line
When using the Lists > "Place commas before items" combined with the CTE >" Place CTE name on a new line" options, the subsequent CTEs are getting placed on new lines after the comma is already on a new line, resulting in:
WITH
myCte
AS ( SELECT 1 a )
,
mySecondCte
( Col1, Col2 )
AS ( SELECT
'Test' AS ThisIsAColumn
, 'Test2' AS ThisIsAnotherColumn
FROM Person.BusinessEntityContact )
SELECT *
FROM myCteI believe this combination of settings should be resulting in:
WITH
myCte
AS ( SELECT 1 a )
, mySecondCte
( Col1, Col2 )
AS ( SELECT…1 vote -
Place empty lines between BEGIN/END and their contents
The Whitespace > "Empty lines between statements" option doesn't appear to consider BEGIN/END as separate statements from the code between them, resulting in formatting like:
WHILE @@ROWCOUNT > 20
BEGIN
IF @BusinessEntityID > 0
DELETE FROM HumanResources.Employee_Temporal
WHERE BusinessEntityID = @BusinessEntityID;
ELSE
BREAK;IF @OldId < 2000
RETURN @OldId;
END;Please modify the behavior or provide another option such that the following result can be achieved:
WHILE @@ROWCOUNT > 20
BEGINIF @BusinessEntityID > 0
DELETE FROM HumanResources.Employee_Temporal
WHERE BusinessEntityID = @BusinessEntityID;
ELSE
BREAK;IF @OldId < 2000
RETURN @OldId;END;
1 vote -
Align tables within FROM clause
Currently, I can get SQL Prompt to format my SQL like this.
SELECT
tbl.name AS TableName,
col.name AS ColumnName
FROM
sys.tables AS tbl
INNER JOIN
sys.columns AS col
ON
tbl.objectid = col.objectidThis annoys me because the tables in the FROM statement are not aligned. I would like to be able to achieve something like below where the tables are aligned and the join and ON are indented from the table. So the tables are indented from the FROM and the INNER JOIN is indented from the table. Then, the ON can either be indented from table or…
1 vote -
Formatting style for CASE statement: on a new line
Add a feature for the formatting styles for CASE expression.
Currently the formatting is so strange, it adds indents that don't make sense.
It should have the possibility to add CASE on a completely new line.Please add :Start expression on a new line or something…
2 votes -
Format SQL & Entity Framework — making EF SQL easily readable
I have the misfortune of trying to read an EF query. It would be extremely helpful if the «Format SQL» function in SQL Prompt could greatly reduce the verbosity and make the massively nested queries much, much easier to read.
This is what I am doing by hand:
• Replacing names like 'Extent6' with letters of the alphabet. I will go back later and replace these letters with more helpful names. Because the aliases of the table-valued objects are so long, so is there so much more text to plough through;
• Removing aliases from columns whose names are identical.…
1 vote -
SQL Prompt - More Granular Suggestion. WHERE AND / CASE AND
SQL Prompt - More Granular Suggestion. WHERE AND / CASE AND
Would you add a couple of settings that give users more granular control in formatting SQL Prompt, please?
In the CASE section, please add a section on how to handle Case AND statements, if we want the AND on a new line or the same line, and where to Align the AND.
Also, please add a checkbox to align any '=' signs, like CASE WHEN colA = 1 then 1 else. I'd like all = signs to line up when there are multiple WHEN statements.
Also, Please add a…
2 votes -
Option to Change != to <>
Although used quite often, != is not ANSI compliant for NOT EQUAL. Have an option in SQL PROMPT Code Formatting to automatically replace != with the ANSI compliant <>.
2 votes -
save /copy result grid as html table
SQL Complete has a great feature to allow copying the result as html table. I wish this feature was available in RedGate. This is the feature I would use multiple times every day.
1 vote -
Aliases for synonyms
When using a synonym, the alias name generated is based on the synonym orginal table, not in the synonym name.
So, if I have a synonym named sch1.ShortTableName that maps on AnotherDatabase.sch2.TableWithLongAndComplexName
If I write
SELECT * FROM sch1.ShortTableName
It ends being
SELECT * FROM sch1.ShortTableName AS twlacn
It would be good that in case of synonyms, the alias name was based on the synonym name, not on the source object name.
Or to keep backwards compatibilty, to have a setting that lets us choos either to follow the synonym name or the source object name.
2 votes -
Allign all euals of a set part in an updatestatement
Allign all equals of a set part in an update statement
2 votes -
Formatting Styles should include Global Style parameters
Global formatting options like "Insert Semicolons", "Add brackets to all identifiers" etc should be part of a formatting style, this way changing a formatting style can also quickly switch between these options.
Currently even after changing a formatting style these options on the screenshot below had to be manually changed one by one, it's inefficient to say the least.3 votes -
New Case When Intend option
The new option would allow intending from alias (in alias = expression notation)
5 votes -
Version Stamping
Our dev group versions our styles. A small change between style versions can cause numerous changes in a single file making peer reviews more difficult than they need to be.
My suggestion is to add an Format > Styles > Actions option to add style stamp. Implementation would be adding a comment with a style/version stamp at the top of the file when a format is applied. If the comment exists prior to formatting, that style will be used by SQL Prompt regardless of selected style. If the style/version is not found, the selected style is used. To change which…
1 vote -
Add a table alias as a prefix to selected column names
I would love an option where, after adding an alias to a table, you can add it as a prefix to all columns coming from that particular table at once.
Some keystroke like Ctrl + F2 would be nice.
3 votes -
2 votes
- Don't see your idea?