80 results found
-
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.
-
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!
-
Remove extra space between statements option is Needed
SELECT
*
FROM
Temp1--Remove this kind of extra spacing between statements option is Needed
SELECT
*
FROM
Temp2--Remove this kind of extra spacing between statements option is Needed
SELECT
*
FROM
Temp310 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!
-
Surround list of values with quotation marks and separate by commas
when creating a WHERE colname IN ('a','b','c')
it would be nice if you could paste a set of rows from excel into SSMS and then add the quotation marks and commas
i.e.
A
B
Cbecomes
'A',
'B',
'C'7 votesSQL Prompt 7 now has an “Add quotes and commas” feature which can be accessed by selecting the block of text and tapping ctrl to bring up the Actions List. You can download the latest version from http://www.red-gate.com/products/sql-development/sql-prompt/
-
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
-
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/
-
Inserting the AS keyword for aliases
It would be nice if one could click a button and get the AS keyword between an object name and its alias. This would help with code that doesn't use AS to separate the two. And would also help readability.
Thanks.
4 votesThis 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 -
RECEIVE statement - Format SQL ignores
;
RECEIVE TOP(1)
@h = conversationhandle,
@t = messagetypename,
@b = messagebody
FROM SimpleQueueTargetFrom the Service Broker Workbench on Simple Talk.
It only moves the semicolon to a separate line. No errors. Ignores "comma at start".
And, yes, the @'s above probably start in column 1, when they're actually in col 5.
1 voteThis 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 -
Give Format SQL the ability to convert X.Field1 AS NewFieldName format to FieldName = X.Field1
We have a lot of legacy code that is written as
SELECT Field1 as Name1, Field2 Name2 FROM Table X
(Sometimes they use AS when setting the alias, othertimes they do not).I would love the ability to convert this to
SELECT
Name1 = X.Field1
, Name2 = X.Field2
FROM Table XBoth having the ability to switch between Name = Value and Value AS Name and to auto add the alias to all fields.
9 votesThis 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 -
Remove trailing spaces
Option to remove trailing spaces from script lines. This can be done via search/replace functionality but it would be nice to have this taken care of automatically during the SQL code reformatting
7 votesVersion 8 of SQL Prompt allows you to do this as part of its 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
-
Qualify Ojects in SQL (Add square brackets)
When formatting SQL, add an option to force all possible columns/objects/whatever to be qualified with square brackets. So:
CREATE TABLE #qqqqq (aaaaa INT,bbbbb INT,ccccc VARCHAR(5));
Becomes: CREATE TABLE [#qqqqq] ([aaaaa] INT,[bbbbb] INT,[ccccc] VARCHAR(5));
Or: CREATE TABLE [#qqqqq] ([aaaaa] [INT],[bbbbb] [INT],[ccccc] [VARCHAR](5));3 votesThis is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Highlight --TODO and --HACK comments
When a --#TODO: or --#HACK is written on our code, it could be helpful to highlight it in order to give an alert to the reader. In addition it can be very helpful to let the user to configure the pattern (i.e. --#MyTerm).
46 votesWe’ve released support for highlighting TODOs in version 9 of SQL Prompt as part of its new code analysis feature.
You can get the latest version of SQL Prompt from https://www.red-gate.com/products/sql-development/sql-prompt/.
We’re marking this request as completed, but if you feel strongly about being able to configure the term, please feel free to open a new suggestion.
Kind regards,
The Prompt Team
-
Support a common intending option for SELECT
Sample query (spaces marked with underscores):
SELECTstaffId, staffName, a
FROM__personnelSELECT and FROM have whitespace after them to align the rest of the statement. This formatting style is tedious to maintain and almost nowhere to be found in real codebases or on the web. Please support the more common code style:
SELECTstaffId, staffName, a
FROMpersonnelJust one space.
41 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!
-
Add brackets to all database objects
Similar to the existing Qualify Object Names and the other pending request to fix case of all object names, I would like to have an option to add brackets added to all database object names (columns, tables, schemas) where they are missing.
13 votesThis is included in SQL Prompt 6.5 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Formating create table command
Currently when formatting a Create table command the SQL Prompt is moving the "Default" to a next line and indenting it...
like this
[insertDT] DATETIME NULL
[______INDENT] DEFAULT GETDATE()
,[ActualMU] INT NULL
[___INDENT]DEFAULT 0
,[PlannedMu] INT NULL
[___INDENT]DEFAULT 0
,[CompletedDT] DATETIME NULL
[___INDENT___] DEFAULT GETDATE()And the format that I would like to see (making easier to read) is
keeping all definition of each field in the same line, like,[insertDT] DATETIME NULL DEFAULT GETDATE()
,[ActualMU] INT NULL DEFAULT 0
,[PlannedMu] INT NULL DEFAULT 0
,[CompletedDT] DATETIME NULL DEFAULT…5 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 -
Stop auto Uppercase conversion of keywords in comments
When a word is entered in a comment block, that is the same as a keyword (e.g. FROM), SQL Prompt should not automatically convert the word to uppercase.
5 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Its a very nice tool who made developer life very easy and do a major and boring task of code formatting by just pressing CTRL+K+Y.
Its a very nice tool who made developer life very easy and do a major and boring task of code formatting by just pressing CTRL+K+Y.
i need a feature who can help developer very much like 1)If there is a SQL Insert query and i select a field it should highlight the value assigned to that selected field because finding this become more painful in formatted code.7 votesSQL Prompt now contains the Highlight Matching Objects feature: https://documentation.red-gate.com/display/SP7/SQL+Prompt+7.1+release+notes#SQLPrompt7.1releasenotes-Highlightmatchingobjects
-
Option to align AND predicates with WHERE
Would love to be able to have all predicates at the same indent level ie:
WHERE something = yetsomethingelse
AND somethingelse = anotherthing9 votesWe’ve released support for formatting options such as this in version 8.0 of SQL Prompt.
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
-
Format "case" keyword also in uppercase
When formatting a case statement I want the case keyword to show in uppercase just like the when and end keywords. Now initially it uppercases CASE but when running SQL format it turns it to lowercase (bug?) See example below of the current format behaviour.
SELECT case WHEN 1 = 1 THEN 1
ELSE 0
END1 voteThis should be fixed in the latest build of Prompt
-
Unwrap sp_executesql
Frequently I need to debug application generated SQL obtained via Profiler. Parameterized queries are often implemented with sp_executesql.
I love using Format SQL to make a single line monster query into something I can actually read. But when it's stuck in an spexecutesql call the format function doesn't touch it. I have to:
Remove "Exec spexecutesql".
Remove the apostrophes around the query SQL. For big queries this is really painful, especially if the query itself contains apostrophes.
Remove the apostrophes around the parameter defenitions.
Move the parameter definitions to the top and add a DECLARE.
Move the parameter…18 votesThis 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
- Don't see your idea?