156 results found
-
Add formatting for CREATE EXTERNAL TABLE syntax
CREATE EXTERNAL TABLE and CREATE EXTERNAL DATA SOURCE syntax is not formatted nicely by SQL Prompt, it just puts the statements on one line.
I've been told the developers are not going to take this on!!!!
2 votes -
Recognize the DateTrunc function in T-SQL.
The formatter is not recognizing the newish DateTrunc function in T-SQL, so formatting and intellisense do not work on SQL statements that include DateTrunc.
3 votes -
support for new SQL Function DATE_BUCKET
Please add support for new SQL Functions such as DATE_BUCKET
https://learn.microsoft.com/en-us/sql/t-sql/functions/date-bucket-transact-sql?view=sql-server-ver16Currently it get quoted which is quite inconvenient.
declare @date datetime2 = '2020-04-30 21:21:21' Select 'Week', DATE_BUCKET(WEEK, 1, @date) Union All Select 'Day', DATE_BUCKET(DAY, 1, @date) Union All Select 'Hour', DATE_BUCKET(HOUR, 1, @date) Union All Select 'Minutes', DATE_BUCKET(MINUTE, 1, @date) Union All Select 'Seconds', DATE_BUCKET(SECOND, 1, @date);
becomes
…DECLARE @date DATETIME2 = '2020-04-30 21:21:21'; SELECT 'Week', [DATE_BUCKET] ( [WEEK], 1, @date ) UNION ALL SELECT 'Day', [DATE_BUCKET] ( [DAY], 1, @date ) UNION ALL SELECT 'Hour', [DATE_BUCKET] ( [HOUR], 1, @date ) UNION ALL SELECT 'Minutes', [DATE_BUCKET] ( [MINUTE],
1 vote -
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…
1 vote -
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…
5 votes -
Format on Save
Allow an option when saving / running a file that you format the sql to the format selected. Will make sure the whole team follow the standards and does not forget to run the formatter.
2 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
3 votes -
Allow SQL PROMPT to resolve constants in an ORDER BY clause
If I create a query with an ORDER BY clause such as ORDER BY 1, 2; SQL Prompt will flag the ORDER BY and report ORDER BY clause with constants.
It would be nice to have an option to have SQL Prompt replace the constant(s) with the correct column names.
3 votes -
Moving commas INDEPENDENTLY between front and end (for debugging mainly)
DAX Studio has a splendid feature that I think is missing from SQL Prompt and could be rather easily implemented. In DAX Studio one can switch with one mouse click between putting commas before or after the column names. The "before" option greatly speeds up debugging but such formatting should not be left in production. In prod we want to have commas after the column name. Would it be possible to add a quick action or option to SQL Prompt so that commas are immediately placed at the end or beginning of column names? I know there are formatting styles…
4 votes -
Correctly bracket Windows users/groups when using CTRL+B,CTRL+B
When adding brackets via CTRL+B,CTRL+B, Windows-based principals (users, groups, etc.) are not correctly bracketed. The brackets are placed around the domain or computer name portion of the principal, instead of the combination of the domain/computer and user/group name.
For example, if this statement is entered
ALTER SERVER ROLE sysadmin ADD MEMBER MYDOMAIN\USER
using CTRL+B,CTRL+B will yield this:
ALTER SERVER ROLE [sysadmin] ADD MEMBER [MYDOMAIN]\USER
instead of the correct syntax:
ALTER SERVER ROLE [sysadmin] ADD MEMBER [MYDOMAIN\USER]
Would also be helpful if principals from NT AUTHORITY and NT SERVICE could be correctly handled.
1 vote -
Indent FROM clause
Allow the FROM, WHERE, GROUP BY, etc. clauses to indent from the select.
Change
SELECT Col1,
Col2
FROM Tab1
WHERE a = bTo
SELECT Col1, Col2 FROM Tab1 WHERE a = b
3 votes -
Align SET statements around = sign
I am a brand new user (1 day) for SQL PROMPT. I managed to get my parameter statements to align, but there is no option on my custom formatting style to align my set statements. See the attached jpg. Trying to get it to look like the yellow highlighted area.
2 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.orderID4 votes -
restore from url breaks SQL formatter
The below script causes SQL Formatter rules to fail with the error "Script parsing error(s) ... Incorrect syntax near url. ... Failed refactorings: Insert semicolons (Script parsing errors)"
create database foo; go backup database foo to url = N'https://foocorp.blob.core.windows.net/backups/foo/foo_1.bak'; go restore database foo from url = N'https://foocorp.blob.core.windows.net/backups/foo/foo_1.bak'; go
SSMS Parse (
ctrl+F5
) reveals that this snippet parses correctly. When replaced with a valid URL target, this syntax also executes without error.Please update the semicolon rule and any other necessary rules to handle for backup/restore from URL as a valid formattable syntax.
(possibly related? https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/40184173-format-sql-backup-to-url-with-credential-breaks-co)
1 vote -
SQL Prompt Support for Azure Synapse (Azure SQL Data Warehouse)
Please add support for
SQL Prompt Support for Azure Synapse (Azure SQL Data Warehouse)26 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.
4 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
4 votes -
Additional options for formatting the ON constraints of a JOIN
It would be appreciated if you could enhance the SqlPrompt Formatting Styles functionality for the Clauses >>> JOIN section. I'd like the ON keyword to stay on the same line as the table-name, but when constraints are line-wrapped, I'd just like them to be "normally" indented.
Presently, the only way to get close to this behavior is to check the "Place ON keyword on new line" checkbox and set "ON keyword alignment" to "Indented". But I don't want that box checked.
3 votes -
Have formatting features for cross join match those of left/right/inner join
I have set up rules to format as such:
Select *
From Employees e Join
People p On e.PersonID = p.PersonID;Each table/view object aligned on a new line. However, when I convert to a "cross join", they don't generate a new line, they concatenate on the same line, like such:
Select *
From Employees e Cross Join People p;2 votes -
Bulk Formatting or Bulk Code Analysis
It would be nice if the new Bulk Formatting or Bulk Code Analysis functionality could also target items directly in the database. This would save time because I wouldn't first have to save objects definitions to my computer.
1 vote
- Don't see your idea?