187 results found
-
Place empty lines between BEGIN/END and their contents
The Whitespace > "Empty lines between statements" option doesn't appear to consider BEGIN/END as separate statements from the code between them, resulting in formatting like:
WHILE @@ROWCOUNT > 20
BEGIN
IF @BusinessEntityID > 0
DELETE FROM HumanResources.Employee_Temporal
WHERE BusinessEntityID = @BusinessEntityID;
ELSE
BREAK;IF @OldId < 2000
RETURN @OldId;
END;Please modify the behavior or provide another option such that the following result can be achieved:
WHILE @@ROWCOUNT > 20
BEGINIF @BusinessEntityID > 0
DELETE FROM HumanResources.Employee_Temporal
WHERE BusinessEntityID = @BusinessEntityID;
ELSE
BREAK;IF @OldId < 2000
RETURN @OldId;END;
1 vote -
Align tables within FROM clause
Currently, I can get SQL Prompt to format my SQL like this.
SELECT
tbl.name AS TableName,
col.name AS ColumnName
FROM
sys.tables AS tbl
INNER JOIN
sys.columns AS col
ON
tbl.objectid = col.objectidThis annoys me because the tables in the FROM statement are not aligned. I would like to be able to achieve something like below where the tables are aligned and the join and ON are indented from the table. So the tables are indented from the FROM and the INNER JOIN is indented from the table. Then, the ON can either be indented from table or…
1 vote -
Format SQL & Entity Framework — making EF SQL easily readable
I have the misfortune of trying to read an EF query. It would be extremely helpful if the «Format SQL» function in SQL Prompt could greatly reduce the verbosity and make the massively nested queries much, much easier to read.
This is what I am doing by hand:
• Replacing names like 'Extent6' with letters of the alphabet. I will go back later and replace these letters with more helpful names. Because the aliases of the table-valued objects are so long, so is there so much more text to plough through;
• Removing aliases from columns whose names are identical.…
1 vote -
save /copy result grid as html table
SQL Complete has a great feature to allow copying the result as html table. I wish this feature was available in RedGate. This is the feature I would use multiple times every day.
1 vote -
Version Stamping
Our dev group versions our styles. A small change between style versions can cause numerous changes in a single file making peer reviews more difficult than they need to be.
My suggestion is to add an Format > Styles > Actions option to add style stamp. Implementation would be adding a comment with a style/version stamp at the top of the file when a format is applied. If the comment exists prior to formatting, that style will be used by SQL Prompt regardless of selected style. If the style/version is not found, the selected style is used. To change which…
1 vote -
Database-specific snippets
Database-specific snippets.
We have 80 or so databases scattered across 200+ instances and many tables have similar names or identical names with differing schemas: compare person.personpe, dbo.person & finance.personpe. This particular is extreme and there are more examples but the principle applies.
I would love to be able to define pe as a snippet at a database level so that I can keep my snippet names short and so that I don't have to rename them manually when I am in SSMS with a lesser used database.
1 vote -
Revisit "Formatting SQL Transaction"
A previous request titled "Formatting SQL Transaction" was flagged as Completed in 2018; however, no option to adjust the formatting for BEGIN TRAN / COMMIT TRAN blocks exists in the latest release of SQL Prompt version 10.
1 vote -
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 -
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 -
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 -
Use formatter to create table of contents
It would be great to be able to use the formatter to create an automated table of contents based on some recognized commented pattern. For example, I could begin each section of code with:
--******
-- Title of section
--******Then after using the formatter it would see the commented section and add the line number for each section in the beginning of the script. I imagine something similar to MS Word's auto generated table of contents.
1 vote -
Separate UDF Formating from Built-in in "Function Calls"
We cannot treat UDF parameter listing/indentation in similar vein to Stored Procedure call formatting. All "Functions", be they UDF or built-in, are lumped into the same four RESTRICTIVE options on the "Function calls" page, and we have no "parentheses style" options for them.
We need:
1. Separation by type (UDF vs. Built-in).
2. Global ==> Parentheses, to apply to UDFs, by our choice.Thanks.
1 vote -
Add quotes and commas function with commas before
Please can the "Add quotes and commas" action conform to the current active style's Commas setting?
So if the setting is "Place commas before items", then the action should also place the commas before.
At the moment, I have to run a Format SQL action after using Add quotes and commas, which is cumbersome.
1 vote -
Fix closing quote for 'N' strings
When typing a string preceded with 'N' (like N'string value'), when you type the closing quote it gets doubled. Hard to explain, but easy to reproduce. Just type these two statements into SSMS to see the difference:
SELECT 'Bill' As FirstName
SELECT N'Bill' As FirstName1 vote -
Ability to integrate SQLPrompt Formatting with T4 Visual Studio
I use T4 to generate a significant amount of SQL code. It would be useful for purposes of readability especially, to be able to call the formatter from within a T4 build process.
1 vote -
Alias on Synonym Name
Have auto alias base its output on the alias name instead of the name of the table it is pointing to.
Example: Alias "Transaction" pointing to "TransactionTableWithComplexName" should be "t" and not "ttwcn".
1 vote -
Parentheses
New Parentheses Style - #6 but ends like #1
Numbering starting at the top left as #1 and continuing to the right one as #5. With the next line starting as #6 and finishing on the right of line 2 as #9.
In the global parentheses settings, Lets make a #10 option which works like #6 in all ways except the closing parentheses is aligned with the beginning parentheses like it does on #1. Actually looking at the graphic that shows on #1, this looks like what I want, the trailing parentheses is below the first one, but #1 has…1 vote -
Provide support for "Suffixes to ignore" in "Insert code > Aliasing" options
We use a data warehousing strategy that creates potentially dozens of tables for multi-class entities in the data warehouse, so we have many tables that end in "core". This leads SQL Prompt to alias the object with a final "C" that we then remove manually. For example, our InstanceCore and Database_Core tables are aliased to "IC" and "DC" when we would prefer "I" and "D" respectively.
Can SQL Prompt's Aliasing capabilities be extended to support "Suffixes to ignore" just like the existing "Prefixes to ignore"?
1 vote -
Apply SQL Prompt Styles with Code
I'd like a NuGet lib to be able to apply SQL Prompt styles to a folder of .sql files or a StreamReader string. I have a console app I'm using to produce a lot of Sql Files and I'd like to create a "everything on one-line" style that I use internally when processing things. There could be tons of other uses as well.
1 vote -
Separate "Collapse parentheses if contents are shorter than..." option from Primary Keys
In SQL Prompt, Formatting Styles, I would like to differentiate the “Short parentheses contents” behavior, so it didn’t impact the primary key when I add a Constraint Primary Key Clustered at Create Table time.
I like my PK fields to stand out, not hide in a block of text.
But I also like any other listing of a few fields to be kept on a single line, and not bloating the screen for no reason at all.
Currently, I can’t have both.In short, I want
CREATE TABLE dbo.Orders
(
OrderDate DATETIME NOT NULL,
OrderID INT NOT NULL,
CustomerID INT…1 vote
- Don't see your idea?