184 results found
-
Allow item following AND/OR to be on new line
When formatting SQL, it would be good to have the option to put the item following an AND/OR on a new line and align it, so instead of:
WHERE
OutgoingResults.LoadDateKey = 20191106
AND OutgoingResults.FeedName = 'TestFeed'we have
WHERE
OutgoingResults.LoadDateKey = 20191106
AND
OutgoingResults.FeedName = 'TestFeed'14 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 -
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 -
Formatting of the invocation of a stored procedure
Hi there. Currently, SQL Prompt formats an invocation of a sproc like this:
exec sproc @param1 = ?,
@param2 = ?,
@param3 = ?I'd like to be able to change this into:
exec sproc
@param1 = ?,
@param2 = ?,
@param3 = ?Thanks.
10 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 -
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 -
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 -
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 -
Add "insert missing aliases" during formatting if desired
When typing SQL aliases are inserted automatically if configured. However when opening existing query from some other source it would be nice to execute an options to add missed aliases based on the same configured rules as with editing.
9 votes -
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 -
Suggestion for THIS site
This is a Format SQL request; not for SQL Prompt, but rather for this website. I don't know how many hundreds of examples have been posted where the author spent quite a bit of time formatting an example, only to have the posted code totally bastardized. Have at least a <code> tag that would present the content within the tag in a fixed-width font and not remove leading spaces. I've seen some posts where the poor soul has tried 2-3 times to get their poin t across only to have the presented code rendered in a way that completely loses…
16 votes -
Import and Export Aliases
It would be nice to have the ability to mass import/export aliases.
5 votes -
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 -
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 -
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 -
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 -
Automatically add Schema to tables when formatting.
Provide the option to enable automatic schema addition when necessary. And when there may be more than one candidate schema, provide a warning
6 votes
- Don't see your idea?