80 results found
-
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 -
Unformat SQL
It would great if there was an un-format SQL command, which would basically un-format the SQL by removing all the carriage returns, tabs, extra spaces, etc. I know it seems odd, but we have several applications that use the SQL via external files, so the formatting will not work, and we end up manually removing all the formatting.
7 votesThis is included in SQL Prompt 7 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Do not indent FROM and WHERE clauses
Provide an option to not indent the FROM and WHERE clauses to remain them lined up with the SELECT clause while maintaining a single space after each clause.
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!
-
2012 keywords
2012 keywords like LEAD( LAG( etc.
9 votesWe’ve released SQL Prompt 6 which includes support for 2012 analytic functions (LEAD, LAG, CUME_DIST, etc)
-
Format CTE
Allow users to specify how CTEs should be formatted. Right now I get:
WITH cte
AS (
SELECT
Title
,FirstName
,LastName
FROM
isales.dbo.salesteam
)
SELECT
Title
,FirstName
,LastName
FROM
cteWhat I would like is:
WITH cte
AS
(
SELECT
Title
,FirstName
,LastName
FROM
MyTable
)
SELECT
Title
,FirstName
,LastName
FROM
cte26 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!
-
Change formatting of IF statements.
When an IF is short and does not have a BEGIN END on it, have it format to a single line.
Right now if you have
IF @Parameter1 = 0
RETURN -1
IF @Parameter2 = 0
RETURN -2I would like it to be:
IF @Parameter1 = 0 RETURN -1
IF @Parameter2 = 0 RETURN -2which would make it more compact.
23 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 -
One line SQL from context menu - Opposite if Format SQL
Have a function which is the opposite to 'Format SQL' so you can select a section of text and have all the Line Breaks and padding taken out. Currently I use HTML Shrinker Pro to do this, but it would be nice to select a block and one line it eg..
@DateAppointed = CASE WHEN LEN(DateAppointed)> 1 THEN DateAppointed ELSE @Unknown END ,2 votesSQL Prompt 7 has an “Unformat” action in the new Actions list. The full release notes can be found here http://documentation.red-gate.com/display/SP7/SQL+Prompt+7.0+release+notes
-
Format SQL so keywords are right aligned
SELECT Number1
,Number2
,Number3
FROM table r
JOIN table2 tf
ON r.column = tf.column
AND r.column = 0
WHERE column = 0
AND column1 = 22 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 -
Ability to quickly switch SQL formatting styles.
We need the ability to quickly switch between T-SQL Formatting styles.
I work on a team where everyone likes code formatted differently. Also, we're required to use a specific format before checking SQL Code into TFS. I need a quick way to switch between styles so I can code in a format I like and then switch to our standard before check-in. Toad already offers this.
8 votesVersion 8.0 of SQL Prompt allows you to quickly switch between formatting styles by clicking SQL Prompt → Active Style → (the style you’d like).
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
-
Ability to "automatically" remove comments from a section of code.
I really like how SQLPrompt assists with Insert Statements. However, I am then left with a large list of comments which I'm not allowed to check into source control. Therefore, I have to manually delete each line of comments.
Example:
Insert into Blah blah..VALUES ('', -- fenumber - char(3)
'', -- finumber - char(3)
'', -- fpartno - char(25) )When I enter the values, I want to be able to auto-eliminate the comments.
7 votesThis is included in SQL Prompt 7 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
anywhere in the script file if the last line below is used it causes an error. CREATE SEQUENCE [dbo].[ReportComparisonSeq] AS INT START WI
sequences in sql 2012 is not supported by the formatter
anywhere in the script file if the last line below is used it causes an error.
CREATE SEQUENCE [dbo].[ReportComparisonSeq] AS INT START WITH 1 INCREMENT BY 1 NO CYCLE CACHE 10
go
DECLARE @Seq INT
SELECT @Seq = NEXT VALUE FOR [dbo].[ReportComparisonSeq]4 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
SQL PROMPT 5 - Simple, but toggle indenting of else if statements
Allow the option to NOT indent else if statements. Each of the ELSE IF statements gets further indented and for large SQL it becomes indented off the screen. I can imagine this pattern could apply else where but for this specific use case our STPs that have this condition i simply can't format the sql because it requires me to horizontally scroll. Allowing me to disable indenting ELSE IF statements would solve this problem instantly.
21 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!
-
Format selected code
Formatting a section (selected code block) with CTRL+K, CTRL+Y). This would allow me to highlight a section of a proc and format it to my liking and leave the (abomination) of the proc body untouched.
3 votes -
Option to place Table names on the same line as the keyword
Currently, no matter what settings are applied, table names are always placed on a new line, for example:
SELECT
ID,
ThingFROM
TableNameJOIN
OtherTableName
ON blah=mooWHERE
something <> something elseMy personal preference is for:
SELECT
ID,
ThingFROM TableName
JOIN OtherTableName
ON blah=mooWHERE something <> something else
Please can we have an option to achieve table names on the same line as their action (FROM / JOIN)
13 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!
-
Automatic semicolons
Include an option when reformatting SQL to automatically add semicolons at the end of each statement if they are missing.
While in most cases SQL Server 2005 and 2008 don't require this, the 2008 docs mention that a future version might.
and it may also be helpful if trying to move code from SQL Server 200x to a dialect which does require them.85 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Line up type declarations
I would like an option to align the type declarations, for example when declaring the columns in a table variable I currently get:
DECLARE @MyExample TABLE
(
MyCol1 INT ,
MyOtherCol VARCHAR(10)
)Which I would quite like to see laid out as:
DECLARE @MyExample TABLE
(
MyCol1 INT ,
MyOtherCol VARCHAR(10)
)The same is true for all other places where I'm declaring, so the parameters for a procedure for example
12 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!
-
format join
I would like the ability to get Format SQL to handle my JOIN formatting - I like to have my JOINs look like this:
SELECT
(columns)
FROM
sys.tables t
INNER JOIN
sys.indexes i ON t.OBJECTID = i.objectidThat is: I want to have my tables being joined lined up with the (intended) table in the FROM clause, and I like to have my JOIN condition on the same line as the joined table.
Right now, I cannot seem to get this to work - the table name and join condition are always stuck onto the same line as…
7 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 -
Enhance the Format SQL to recognize the WITH clause.
When the WITH clause is specified in the FROM clause on a JOIN, Format SQL pushes the join condition out to the WITH.
Like this:
FROM
TableA WITH (NOLOCK)
JOIN TableB WITH (NOLOCK)
ON TableA.ID = TableB.IDI would like it to behave like it does when the WITH is not present
FROM
TableA WITH (NOLOCK)
JOIN TableB WITH (NOLOCK)
ON TableA.ID = TableB.ID7 votesThis is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
"commarise"
When copying a list of items from something like Excel, it would be lovely to have a feature in Prompt which would highlight the list, hit a key stroke and it would place quotes around each item and a comma after them.
It would stop me bashing the quote + arrow + comma keys at the speed of light.
22 votesThis is included in SQL Prompt 7 which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
SELECT DISTINCT starts new line and loses indentation; keep SELECT DISTINCT on same line please.
I believe the DISTINCT keyword should remain on SELECT line but at least maintain the indentation please. Thanks
6 votesWe’ve released support for this piece of formatting in version 8 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
- Don't see your idea?