172 results found
-
Template based formatting with different
Template based formatting.
Select your text and right click, format according to template... then select the appropriate template of your choice.8 votes -
Auto-Correct TOP to include Parenthesis
Add an Enable checkbox in the Style Sheet | Global | Parenthesis settings.
When SQL Prompt encounters the 'old style' usage of TOP, without parenthesis, automatically enclose the apparent 'what' in parenthesis.
7 votes -
Switch between Alias formats AS/=
A formatting feature to change syntax between these two forms
SELECT field1 AS Alias1, field2 AS Alias2 FROM table1
SELECT Alias1 = field1, Alias2 = field2 FROM table1
Ideally useable without having to invoke the "Format SQL" command.
Hopefully selectable as an enabled option within a Format SQL style set.I spend a non-trivial amount of time reformatting SQL code for leading/trailing comma placement and alias AS/= placement, this would be a HUGE help
7 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 -
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 -
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 -
More Casing/Capitalization Options
Regardless of the source table, we would like the option to force table, column, and alias names to lower case. (We integrate databases from multiple sources and our queries look like a mess when half of the columns are upper case and half are lower).
Example:
SELECT dp.PROJID AS cpprojid,
pld.suffix AS projectsegment,
IP.projectnumber AS innprojid
FROM DEL.PROJ AS dp
INNER JOIN DEL.viewprojectlvldetail AS pld
ON pld.PROJID = dp.projid
LEFT OUTER JOIN inn.PROJ AS IP
ON dp.PROJID LIKE IP.cpproj_id + '%'I think this is hard…
7 votes -
Enable block comments in SQL
SQL Prompt and SSMS do not have the option to create/remove block comments. This is a serious problem.
We SQL Prompt users would love the option to add/remove block comments in SQL, between the marks /* and */, because they sometimes serve very different purposes.
Inline comment options (Ctrl + K, Ctrl + C or Ctrl + K, Ctrl + U) are helpful, but they don't always do exactly what we need. Sometimes they can break things. See below.
/*
Sometimes we need block comments that cover multiple lines.
Like this.
/
/ Or comments where each line begins and…6 votes -
Add the ability to specify a named formatting style using a comment block.
Add the ability to specify a named formatting style using a comment block.
Add functionality to specify, in a comment block, what formatting style should be used when formatting the current file. It could be a simple addition to the existing turn-on/off formatting comment.
Perhaps something like this:
--SQL Prompt Formatting On - Style = "My Style"The above would turn on formatting and specify what style to use.
This functionality would be helpful in many ways.
It is already convenient to have multiple formatting rules, this would keep the user from having to remember what rules apply to what…
6 votes -
Option to prevent removal of brackets on database and server names
Removing brackets from database names causes VS schema compare to indicate file differences because VS requires database reference variables to be enclosed in brackets. Need an option to exclude removal of brackets from database and server in three and four part names.
6 votes -
Unformat Query
Add a menu Item option to unformat a query. In other words take the query that is highlighted or every query in the script and convert them to be on a single line with only a single space between keywords, words, and operators.
This would be very useful for having to copy SQL into a table or other some object that shouldn't have normal formatting in it.
An option would be to double up all single quotes, so that the query can be placed between single quotes.6 votes -
Properly format the start of a CTAS in Azure Synapse Analytics
SQL Prompt does not start a new line for the SELECT portion of a CTAS statement within Azure Synapse Analytics when there is a defined distribution or index using a WITH clause. Instead the SELECT statement is tabbed way over to the right.
6 votes -
Allow block comments /* SQL Prompt formatting off */ to disable T-SQL formatting
SQL Prompt should allow block comments /* SQL Prompt formatting off */ to disable T-SQL formatting.
Single line comments are a pain when tuning queries. I would always use block comments in my code except when I don't want SQL Prompt to not mess with certain T-SQL it does not format to my standards.
Blocking formatting should support both type of comments.
/* SQL Prompt formatting off */
-- SQL Prompt formatting off6 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 -
Outlining
Would be great to be able to add user specific outlining, so that you could add + & - where ever you choose in a sql script to collapse down certain parts. The CRM system that I support has a create contact table import with 200 columns which is regularly used and this functionality would be great when having to resort to using this import etc...
6 votes -
Copy as IN clause should follow formating setting
I use the Copy as IN clause a lot and think it is one of the most helpful functions in SQL Prompt.
It would be even better if it could format the IN list according to the Style setting you have selected.
This is how it is created when right clicking on the function
ContractsId IN
(
234151,
234321,
239990,
228809,
240808,
231809,
240021,
230876,
231739,
239555,
240972
)If I then use format SQL it changes it to the way I want it, without line brakes for each row but in relation to the other statement.
It would be…
5 votes -
Add or remove square brackets (easily!)
Have buttons to add/remove square brackets rather than tucked away under Options, so they can be toggled on or off easily.
And/or move the square brackets option out of Options and into the actual formatting style (like the option to remove additional whitespace) so it can be saved and shared as a template
5 votes -
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
- Don't see your idea?