80 results found
-
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],
2 votesSupport for DATE_BUCKET shipped in SQL Prompt 10.13.9 https://documentation.red-gate.com/sp/release-notes-and-other-versions/sql-prompt-10-13-release-notes
-
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.
4 votesShipped in version 10.13.10: https://documentation.red-gate.com/sp/release-notes-and-other-versions/sql-prompt-10-13-release-notes
-
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 votesSupport shipped in 10.13.9 https://documentation.red-gate.com/sp/release-notes-and-other-versions/sql-prompt-10-13-release-notes
-
Command Line "Reformat All Files In Folder" and pre-Commit
Opening over 2500 code objects to set a baseline format, required by a large customer, is a daunting manual task.
Many of Red Gate's tools provide command-line functionality.
Please add it to Prompt so we can bulk (re)format SPs, UDFs, Triggers. Integration into the commit-path (we use SVN) would be ideal for standardized check-ins (Commits).
Can't recall whether a style is exportable... (License key awaited at new employer) Should be able to point to UNC location for the style to use.
109 votesBulk operations for formatting and code analysis were added as part of SQL Prompt 10.7
-
Warning on delete and update statements if no WHERE clause is specified
It would be nice to get a warning on delete or update statements if you did not specify a where clause.
23 votesSQL Prompt 7.2 displays execution warnings before executing DELETE or UPDATE statements without a WHERE clause. You can download the latest version from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Put single quote marks around highlighted text (including multiple lines)
Very often i have copied a list of items i want to query in an IN() statement from the database, for example:
abc
def
ghi
jkland I want to format it like this:
'abc'
'def'
'ghi'
'jkl'or better yet:
'abc'
, 'def'
, 'ghi'
, 'jkl'Being able to highlight, right click, and select an option do do this, would be incredibly helpful.
2 votes -
Formatting SQL Transaction
It would be nice to have the code within a BEGIN TRAN and COMMIT be indented.
BEGIN TRAN
<ssss>INSERT....
<ssss>UPDATE....
COMMIT TRAN6 votesWe’ve released a brand new formatting system in version 8 of SQL Prompt and have made further improvements since.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
If there is something missing please let us know by opening a new suggestion.
Kind regards,
The Prompt Team
-
SQL Prompt > Format SQL Update for SQL Server 2016
Any query where "AT TIME ZONE" is used (new feature in SS '16), the Format SQL throws and error.
"SQL Prompt was unable to complete this operation. Problem areas have been highlighted"
The highlighting start from "AT TIME ZONE..."
Thank you
14 votesWe now support “AT TIME ZONE” in the latest release of SQL Prompt. You can download the latest release here:
https://forum.red-gate.com/discussion/80988/latest-stable-build-of-sql-prompt-is-8-0-0-1241-11th-may#latestThanks for your support!
-
SQL Formatter error
When using OPENJSON with the WITH clause, the formatter does not recognize the WITH clause as valid SQL. This should format but throws an error:
DECLARE @JSONString NVARCHAR(MAX) SET @JSONString = N'{"Vendors":[{"VendorNumber":200,"VendorName":"Vendor1"},{"VendorNumber":201,"Vendo2"},{"VendorNumber":202,"VendorName":"Vendor3"}]}'
SELECT VendorNumber ,
VendorName
FROM OPENJSON(@JSONString, '$.Vendors')
WITH (VendorNumber INT '$.VendorNumber', VendorName VARCHAR(50) '$.VendorName')2 votesThis formatted error has been fixed in the latest version SQL Prompt 8:
https://forum.red-gate.com/discussion/80988/latest-stable-build-of-sql-prompt-is-8-0-0-1241-11th-may#latestThanks for your suggestion!
-
Formatting of AT TIME ZONE
In SQL Server 2016 it is now possible to calculate between timezones. Currently it gives me an error, when I want to format it. The syntax is also not allowed at the moment.
1 voteAT TIME ZONE is now supported in SQL Prompt 7.4
You can download the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Formatting of Valid Selected code when there is invalid code in the script
I used to be able to format selected code, as long as it was valid. Now when I select code that is valid in a larger script that has invalid code it does not format the selected code at all. If the invalid code immediately precedes it it will suggest that there is an error in the first character of my selection when there is none, else it will just act like it did something but do nothing. This used to work and is a frustration now. This has been the case with both 7.3 betas and I believe at…
1 vote -
create or alter
SQL server 2016 SP1 introduced the "CREATE OR ALTER" PROCEDURE/VIEW - syntax, which would be very nice to have support for.
1 voteThis feature was released in version 7.3 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team -
format is now deleting extra lines after the query
Looks like version 7.3 of SQLPrompt removes all blank lines after the query that it formats. Please change this back or make it optional to delete blank lines at the bottom of the query.
1 voteWe’ve just shipped a new beta build (7.3.0.619) that will preserve the extra lines at the end of the query if “Preserve existing new lines between statements” is checked.
You can download the latest beta build from https://forums.red-gate.com/viewtopic.php?f=169&t=79994
-
Add options for CASE WHEN ELSE END
I'd like to be able to configure a style for CASE statements using options like the following:
- New line after THEN
- New line before ELSE
- New line after ELSE
- ELSE match indent of CASE
- END match indent of CASE
It would also be nice to have a threshold setting (in number of characters) so the formatting settings are only applied if the length of a CASE statement exceeds the threshold.
64 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Exclude a region from formatting
Sometimes, formatting makes a query less readable, e.g.
insert table (col1, col2, col3, ....)
values (1,2,3,...),
(11,12,13,...),
...Formatting will put the values on multiple lines if there are enough of them. It's easier to see the data when they are on one line. So how about:
--#region [optional description] #SQLPromptIgnore
--anything in here doesn't get formatted
--#endregion [optional description]Not sure what would be best for '#SQLPromptIgnore'
2 votesAs Joe Momberg said, this is now available in 7.3 – http://documentation.red-gate.com/display/SP7/SQL+Prompt+7.3+release+notes#SQLPrompt7.3releasenotes-Disableformattingforblocksofcode
You can download the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
-
formatting stored proc
I love to have the options so that the first line of a stored proc is just the name i.e. create proc spName and the @parms varchar(20) and following would be on additional lines
So for examplecreate proc spName
@Parm1 int
,@Parm2 intthanks
Shannon4 votesThis feature was released in version 8 of SQL Prompt.
If there are any missing features please let us know by creating a new suggestion.
Kind Regards,
The Prompt Team -
Format SQL - quick styles
I want to switch between TEAM and PERSONAL styles for Format SQL. It currently takes 8 mouse clicks to achieve this. Could you add a style lookup on the context menu or Red Gate tools menu and apply the style to the current document automatically as soon as it is selected.
I want my team to be able to work in their personal SQL format, but always save in the TEAM format.
9 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Stop aliasing scientific notation
SQLPrompt will take scientific notation, and alias it as 1[e1], 1[e2] and so on.
1e1
1e2
1e3
1e4
1e5
1e6
1e7
1e8
1e91 voteHi Erik,
Thanks for letting us know about this issue. It should now be fixed in the latest build of SQL Prompt (7.1.0.314)
-
Disable SQL Prompt on certain blocks of code
Add a functionality of disabling SQL Prompt auto-formatting feature for blocks of code. Use SQL comments for 100% sql compatibility. Example:
SELECT 1, 2, 3
--<SQLPROPMT disable>
select 4, 5, 6
--</SQLPROPMT>
select 7,8,9in the code above, the first and third statements would be auto-formatted but not the second one.
It would be especially useful for very long scripts where a single formatting template is not an option.
64 votesThis feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Allow the option for SQL formatting of nested inner join on an outer join to indent the nested inner join.
When you have a nested inner join to an outer join, such as:
SELECT a., b., c.*
FROM
A a
LEFT JOIN B b
INNER JOIN C c on b.bid = c.bid
ON a.aid = b.aidIt should allow an option to indent the nested join further to show that it is nested
5 votesWe’ve released support for indenting nested joins in version 8 of SQL Prompt as part of our new formatting system.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
If there is something missing please let us know by opening a new suggestion.
Kind regards,
The Prompt Team
- Don't see your idea?