186 results found
-
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 -
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)END,0 votes -
Merge Command Formatting
Merge Command Formatting
For MERGE commands there is no way to make the conditional requirements with 'ON' follow the same style as JOIN's ON. I noticed back on 5/17/2017 there was a closed 'Merge command formatting options' through the User Voice, stating that an experimental feature was available for SQL Prompt 7.4. What happened? In my 10.1.7.15015, within the formatting styles, there is no area for MERGE like there is for JOIN.
9 votes -
Format SQL Backup to URL with credential breaks code
Formatting a SQL batch which contains
BACKUP DATABASE Databasename
TO URL = N'URL'
WITH CREDENTIAL = N'Credential'leads to
BACKUP DATABASE Databasename
TO URL = N'URL'
WITH AS CREDENTIAL = N'Credential'the AS between with and credential is wrong.
Please fix :-)
3 votes -
Ability to integrate SQLPrompt Formatting with T4 Visual Studio
I use T4 to generate a significant amount of SQL code. It would be useful for purposes of readability especially, to be able to call the formatter from within a T4 build process.
1 vote -
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 -
Alias on Synonym Name
Have auto alias base its output on the alias name instead of the name of the table it is pointing to.
Example: Alias "Transaction" pointing to "TransactionTableWithComplexName" should be "t" and not "ttwcn".
1 vote -
CTE column list formatted like the columns in the AS list
The columns listed in the CTE are not formatted like the columns in the AS clause. On larger CTE's, the listed columns may be hundreds or characters long so we get
with xx
( a, b, c, d, e, ...) AS
(Select a,
b,
c,
d,
e,
...3 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 -
Parentheses
New Parentheses Style - #6 but ends like #1
Numbering starting at the top left as #1 and continuing to the right one as #5. With the next line starting as #6 and finishing on the right of line 2 as #9.
In the global parentheses settings, Lets make a #10 option which works like #6 in all ways except the closing parentheses is aligned with the beginning parentheses like it does on #1. Actually looking at the graphic that shows on #1, this looks like what I want, the trailing parentheses is below the first one, but #1 has…1 vote -
Indentation of clauses following alter table
Indent the clauses that may follow an alter table statement. They currently are on the same line or split but not indented.
3 votes -
Whitespace: Tab to indent, then spaces for alignments
Whitespace: I picked up an indenting/alignment pattern from a Stack Overflow thread that solves an abundance of arguments: Please provide the option for using Tabs to indent the line, and then use spaces for alignments following the first character.
3 votes -
Formatting option to columnize not only column names but data-types and nullability as well
Some of us would like the option for formatting of table declarations to not only align [tabify] column names (indented one tab), but also columnize/tabify the data types and nullability so that table definitions are grid-like. Constraints per column are are far more variable and therefore require more of a free format or sometimes pushing them to subsequent lines, but at minimum, the ColumnName, DataType and Nullability should be optioned to columnize by default.
When there are hundreds or thousands of tables in a db schema, I'm used to scanning table definitions, and having them organized grid-like saves my eyeballs…
7 votes -
Autofix : SC002 – Script should end with empty line
SQL prompt currently removes the empty line at the bottom of a script, which then break rule SC002.
Can format include a setting to add a blank line at the bottom of a script, and also autofix sc002 issues.
3 votes -
Auto-generate MERGE comparison clauses
One of the most tedious elements of writing T-SQL is handling of proper comparisons in the WHEN MATCHED AND ... THEN UPDATE clause of a MERGE statement.
For example, to compare a single nullable target and destination column you should compare:SRC.column <> TGT.column
OR (SRC.column IS NULL AND TGT.column IS NOT NULL)
OR (SRC.column IS NOT NULL AND TGT.column IS NULL)I'm not sure on exactly how would be best to handle this but it would be great if SQL Prompt could somehow auto-populate these clauses. Or even better would be some way to generate an entire merge statement…
6 votes -
Option For Aliases (Only For Custon Alias)
Hi
it is better to SQL prompt use only aliases define with user.need option in Aliases : Only For Custom Aliases
Sorry For My Bad English
3 votes -
Option to not square bracket aliases
It would be nice to have an option to not but square brackets around aliases as it's our style to not do so. We find it makes the aliases unnecessarily long,since most of our aliases are 1 or 2 letters.
For example
SELECT
T.[TableId],
T.[Name]
FROM
[dbo].[MyTable] Tvs
SELECT
[T].[TableId],
[T].[Name]
FROM
[dbo].[MyTable] [T]Currently we have to go back and rename an alias to itself so that the square brackets go away.
8 votes -
column alias by column name
Feature to automatically add column alias with the name of the column.
E.g.:SELECT Column1
FROM Table1 AS t1changes to:
SELECT Column1 AS Column1
FROM Table1 AS t1If the name can not be found add a dummy-alias like Exp1
8 votes -
Formatting Styles - More granular control?
I realize my title is very vague.
Basically, I would like more control options over how styles are applied. Maybe I'm just really weird in how I format my SQL, but it seems like no matter how hard I try, I can never get the styles the way I want them.
I realize that it's impossible to make it perfect. But the basic idea is to get the formatter to do what you would normally do the majority of the time.
For example....the majority of the time, I prefer the following...
For JOIN clauses, all join criteria is in the…
7 votes -
Import and Export Aliases
It would be nice to have the ability to mass import/export aliases.
5 votes
- Don't see your idea?