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
-
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
-
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
-
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 -
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!
-
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!
-
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/
-
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 -
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 -
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
-
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)
-
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!
-
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 indent BEGIN/END bloc after AS in function/procedure definition
CREATE FUNCTION MyFunc()
RETURNS INT
AS
BEGIN
----IF 1=1
--------BEGIN
------------<some code>
--------END
END
END1 voteThis should already be an option in SQL Prompt under Format→Schema statements→Indent contents.
-
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
-
Aggregate Functions wrongly put in square brackets
I think I 've found a bug...
If you Format this SQLDECLARE @Translations TABLE ( [FundTypeId] INT NOT NULL , [ColumnName] NVARCHAR(128) NULL , [ColumnValue] NVARCHAR(256) NULL , [InsertedAt] DATETIME NULL , [InsertedBy] NVARCHAR(256) NULL , [LastUpdatedAt] DATETIME NULL , [LastUpdatedBy] NVARCHAR(256) NULL , PRIMARY KEY ( [FundTypeId] ) ); SELECT * FROM ( SELECT [pt].[FundTypeId] , [pt].[FundType] , [pt].[Comment] , [pt].[InsertedAt] , [pt].[InsertedBy] , [pt].[LastUpdatedAt] , [pt].[LastUpdatedBy] FROM @Translations AS [tmp] PIVOT ( MAX([ColumnValue]) FOR [tmp].[ColumnName] IN ( [FundType], [Comment] ) ) AS [pt] ) AS [tmp];
... it will break the code as the MAX function of…
1 voteWe’ve just released a new build of Prompt ( 6.5.0.332) which should have a fix for this. You can get the latest version from our website http://www.red-gate.com/products/sql-development/sql-prompt/
-
semi colon placed on new line
Place semi-colon on new line.
I frequently format my statements as I'm developing them, but multiple times now I've started to add an Order By or some other clause after the auto-inserted semi-colon. I would like to see an option to place the semicolon on the line following the sql statement rather than directly after. This would enable me to start typing at the start of the next line without having to check if a semicolon had been added to the preceding line.
Example:
Select * From Table
Where A = 1; -- Semicolon added by formatting
Order By A9 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!
-
IF statement format options
Please provide the option to format IF statements as follows, based on the format settings sample.
IF @productType IN ('a', 'b', 'd', 'g', 'i', 'O', 'Q', 'X', 'Z') BEGIN
----IF @cost <= @compareprice BEGIN
--------PRINT 'Less than $' + CAST(@compareprice AS varchar(20))
----END ELSE BEGIN
--------PRINT 'Exceeds $' + CAST(@compareprice AS varchar(20))
----END
END
3 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
- Don't see your idea?