184 results found
-
Apply SQL Prompt Styles with Code
I'd like a NuGet lib to be able to apply SQL Prompt styles to a folder of .sql files or a StreamReader string. I have a console app I'm using to produce a lot of Sql Files and I'd like to create a "everything on one-line" style that I use internally when processing things. There could be tons of other uses as well.
1 vote -
Format lists on a clause basis
I would like to control the list behavior on a clause by clause basis so that I can separate the formatting on my DECLARE statements differently than lists within SELECT and INSERT statements. As it stands, these are conflicting changes. So, the only way to get each variable declared on a separate line is to also have every column in other statements on a separate line. I'd like to be able to do BOTH of these:
DECLARE @GUID UNIQUEIDENTIFIER = NEWID(),
@Char CHAR(1) = 'A',
@Int INT = 1,
@Datetime DATETIME = CURRENTTIMESTAMP,
@Decimal DECIMAL(18,10) = 1.0,
@Date DATE…2 votes -
Closing parenthesis and content indention on APPLY/EXISTS not indenting
It seems that the contents and closing parenthesis of EXISTS and APPLY clauses is not being indented as I would expect. So either i'm weird....or Format SQL is doing it wrong?
I'm using (
.....this parentheses style
)What it's doing:
SELECT *
FROM tblA a
WHERE 1 = 1
.....AND EXISTS (
.....SELECT *
.....FROM tblB b
.....WHERE b.Col1 = a.Col1
..........AND b.Col2 = a.Col2
..........AND b.Col3 = a.Col3
)What I expect:
SELECT *
FROM tblA a
WHERE 1 = 1
.....AND EXISTS (
..........SELECT *
..........FROM tblB b
..........WHERE b.Col1 = a.Col1
...............AND b.Col2 = a.Col2
...............AND…3 votes -
Lists formatting for Columns and Parameters should be treated separately
The starting item in a List of Columns for a SELECT statement is fine to place on the same line as the SELECT, however, for EXEC <proc name that is probably longer> it looks odd to have the Parameters line up at the end. This should be a separate choice for EXEC Parameters. I chose the "commas before" style for most everything, but prefer the "default" layout for EXEC proc parameters.
4 votes -
Refactoring INSERT into MERGE
Refactoring INSERT into UPDATE is definitely useful, but most of us are familiar with these. The complex MERGE statement is a mess, and a clean way to generate that would be fantastic!! Especially since you can figure out the primary keys, etc..
4 votes -
Add Support for Microsoft Analytics Platform System
If a sql command is written with an APS specific statement (for example: "CREATE TABLE AS, or "OPTION (Label = 'Query Description')" ), then a script parsing error appears.
9 votes -
formatting of OVER clause
Would like to control formatting of the OVER clause. E.g I would like the complete "(Partition by ... order by ...) as xyz" on one line, but today it's overrdden by other options.
29 votes -
Trim white space
Please add an option be added to SQL Prompt to trim all white space.
Ideally, the following would be supported:
- Ability to execute against a query window or block of selected code
- Available as a stand-alone shortcut
- Can include as part of a Format SQL style
- Option to remove a) leading spaces, b) trailing spaces, c) both8 votes -
format expressions like operator
Would it be possible to treat the 'LIKE' operator the same as '=' in the Expressions\Operators settings so they are all aligned?
select AddressID
from Person.Address
where ModifiedDate
between dateadd(month, -6, getdate())
and getdate()
and City = 'Bothell'
or left(PostalCode, 2) like 'CB%'
or PostalCode = @prefix + @suffix2 votes -
Separate "Collapse parentheses if contents are shorter than..." option from Primary Keys
In SQL Prompt, Formatting Styles, I would like to differentiate the “Short parentheses contents” behavior, so it didn’t impact the primary key when I add a Constraint Primary Key Clustered at Create Table time.
I like my PK fields to stand out, not hide in a block of text.
But I also like any other listing of a few fields to be kept on a single line, and not bloating the screen for no reason at all.
Currently, I can’t have both.In short, I want
CREATE TABLE dbo.Orders
(
OrderDate DATETIME NOT NULL,
OrderID INT NOT NULL,
CustomerID INT…1 vote -
Indent AND/OR in WHERE/GROUP BY/etc. differently than ON clause
Support request #137199: Provide an option to indent AND/OR entries in a WHERE clause to line up indented, but leave AND/OR entries directly underneath ON clauses:
SELECT
t1.col5
, t2.col6
FROM
table1 t1
INNER JOIN table2 t2
ON t1.col1 = t2.col1
AND t1.col2 = t2.col2 -- AND is directly below ON clause
WHERE
t1.col3 = 'Test'
AND t2.col4 = 5 -- AND is indented underneath WHERE2 votes -
Move the Options - Styles configuration to the individual Style definition page
Options - Styles pane contains, for example, "Apply column alias style" and its drop-down. This does not belong as a universal style setting, among others.
Please move it to the "Formatting Styles" configuration dialog.
This is because many practitioners either do not know about the "alias = column" capability in T-SQL, or don't like it, or it's contrary to company standards. The ability to use this form, which IMO is more brain-friendly, ought to be on the Formatting page as it is, in fact, a significant style element.
Thanks.
4 votes -
Align BETWEEN with comparison operators
It's currently possible to align operations in WHERE which is great, but BETWEEN is not aligned.
Example - currently:
WHEREModifiedDate BETWEEN DATEADD(MONTH, -6, GETDATE()) AND GETDATE()
AND City__________= 'Bothell'
OR LEFT(PostalCode, 2)= 'CB'
OR PostalCode_______= @prefix + @suffixExpected:
Example - currently:
WHEREModifiedDate_BETWEEN DATEADD(MONTH, -6, GETDATE()) AND GETDATE()
AND City________= 'Bothell'
OR LEFT(PostalCode, 2)= 'CB'
OR PostalCode_______= @prefix + @suffix3 votes -
Make equals signs line up with tabs
When I type code I like to line up all the equals (=) signs using tabs so that all the code to the right of the equals sign lines up nicely on my screen. I find this really useful for improving readability when using column aliases, in joins, and in update statements.
I can't find an option in SQL Prompt to do this and it annoys me when I format my SQL and all the equals signs become ragged.2 votes -
Prefixes in function parameters
SQL Prompt is removing prefixes from column names used as parameters in function-calls. For example, if you use Cross Apply to a system function:
SELECT *
FROM sys.tables AS T
CROSS APPLY sys.fnlistextendedproperty('blah','schema',schemaname(T.schemaid), 'table', T.name, null, null)
It removes "T." from schemaid and name in the parameters list. This means I have to add them back in if the column names are ambiguous. I don't see a setting for this, and have Prompt set to add prefixes to columns in the other clauses. So it'll add "T." to a column in the Select clause, and remove…4 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 -
Ability to format SQL text externally
It would be nice to have ability to format the documents automatically, have an API or command line command for that. For example to force format when check-in code.
10 votes -
align aliases
Please, separate options to align aliases for columns and tables..... I love aligned column aliases, but table aliases advance too far right, unnecessarily.
7 votes -
Formatting arithmetic - new lines (Apex has this)
The only edge Apex has over SQL Prompt formatting, at least for my use, is being able to organize long equations. If I am using a large number of columns for an equation, I'd like to place each new column on a new line.
1 vote -
Apply casing formatting as I type, but without the suggestions.
Currently, SQL Prompt either allows you to apply casing all at once with the Apply Casing Options, or it does it as you type if Enable Suggestions is turned on.
Please add a feature so that I can have casing applied as I type, but without the suggestions.
4 votes
- Don't see your idea?