186 results found
-
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 -
Formatting of the invocation of a stored procedure
Hi there. Currently, SQL Prompt formats an invocation of a sproc like this:
exec sproc @param1 = ?,
@param2 = ?,
@param3 = ?I'd like to be able to change this into:
exec sproc
@param1 = ?,
@param2 = ?,
@param3 = ?Thanks.
10 votes -
Allow item following AND/OR to be on new line
When formatting SQL, it would be good to have the option to put the item following an AND/OR on a new line and align it, so instead of:
WHERE
OutgoingResults.LoadDateKey = 20191106
AND OutgoingResults.FeedName = 'TestFeed'we have
WHERE
OutgoingResults.LoadDateKey = 20191106
AND
OutgoingResults.FeedName = 'TestFeed'14 votes -
flip between adding and removing square brackets
Add ability to add or remove square brackets without having to edit the settings for which direction you want it to go.
4 votes -
Add "insert missing aliases" during formatting if desired
When typing SQL aliases are inserted automatically if configured. However when opening existing query from some other source it would be nice to execute an options to add missed aliases based on the same configured rules as with editing.
9 votes -
format setting for "Copy as IN clause"
when I paste after "Copy as In clause", got contents like this:
IN
(
1, --comma at behind
2
)I hope got this:
IN
(
1
,2 --comma at before
)please provide option, thanks.
4 votes -
Ignore Begin statements with CTE immediately after
SQL Prompt's "Insert semicolon" function behaves weirdly when a CTE is a the start of a control loop. For example, if I have this code:
IF (1=1) BEGIN
WITH numbers AS (
SELECT 1 AS num
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
)
SELECT * FROM numbers
END;SQL Prompt will format it as
IF (1=1) BEGIN;
WITH numbers AS (
SELECT 1 AS num
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
)
SELECT * FROM numbers;
END;While the code runs, I think the semicolon after "BEGIN" makes very little sense. First, the beginning…
3 votes -
Add one additional Parenthesis style
My Teams would prefer this option:
xxxxxxxxxxxxxx (
xxxxxxx,
xxxxxxx )Opening parenthesis on the first line, and closing parenthesis on the last line.
Second and following lines indented one stop. This display seems to strip out the leading spaces.
4 votes -
Automatically add Schema to tables when formatting.
Provide the option to enable automatic schema addition when necessary. And when there may be more than one candidate schema, provide a warning
6 votes -
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 -
Add space between closing parethesis of a function call and FROM
Add an option to add a space between a function call, such as COUNT(), and FROM so that we don't end up with code like SELECT COUNT()FROM table. That doesn't happen when I select "Add spaces around parentheses" in the global parentheses options. The only way I've been able to get SQL Prompt to preserve that space is to select "Add spaces around parentheses" in the Function calls options, but I don't want a space between the function name and opening parenthesis.
4 votes -
conditions new line after
Currently we have a standard of placing new line before and after conditions with indent accordingly such that:
a=1
AND
b=2Current version only does:
a=1
AND b=2This is pretty much the only thing lacking from being able to just auto format all our procedures with a single click.
4 votes -
"Remove Square Brackets" option
The "Remove Square Brackets" option does not work for "CREATE EXTERNAL TABLE" statement.
Please try this option with the example below and nothing happens.
CREATE EXTERNAL TABLE [ft].[Account]
(
[AccountId] [bigint] NOT NULL,
[AccountType] [nvarchar] (50) COLLATE NOT NULL,
[AccountCreatedDate] [datetime2] NOT NULL
)
WITH
(
DATASOURCE = FinancialDB,
SCHEMANAME = 'Account',
OBJECT_NAME = 'Account'
);2 votes -
Suggestion for THIS site
This is a Format SQL request; not for SQL Prompt, but rather for this website. I don't know how many hundreds of examples have been posted where the author spent quite a bit of time formatting an example, only to have the posted code totally bastardized. Have at least a <code> tag that would present the content within the tag in a fixed-width font and not remove leading spaces. I've seen some posts where the poor soul has tried 2-3 times to get their poin t across only to have the presented code rendered in a way that completely loses…
16 votes -
Additional Formatting Options
These are the typical formatting styles I use that I would like to see definable in SQL Prompt. Currently, I use a style that gets me close then manually format the remainder to the code:
Regarding the desired format of
1) SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY all lined up
2) TAB after SELECT, followed by first 'column'
3) Subsequent columns on separate lines and lined up with the first one.
4) TAB after any CASE followed by first WHEN
5) Subsequent WHENs lined up with first one
6) TAB before THEN (i.e. indented one tab from…4 votes -
Shortcut to move commas from start to end and vice versa.
I would like to only affect the placement of commas in a column list, without applying other formatting options. This would work similar to Ctrl-B, Ctrl-B to remove brackets or Ctrl-B, C to insert semicolons, in that no other formatting would take place.
There are times I have a rather well-formatted script but it has been written with commas at the start of the line and I prefer them at the end. A new shortcut would toggle placing commas at the start or end of the line without affecting other formatting within the script.
5 votes -
Make parentheses rules customizable (where what applies) instead of a global setting
I have different wants for parentheses rules: Collapse short content or not, Having Parentheses on separat lines or leading the content, etc. It all depends on the context. But currently the setting is global.
I would like to be able to define one rule for, say, Primary Key definitions, and another rule for, say, the columns of a table.
I would want one thing for Control Flow sections, and another thing for Variables declarations.Today, I need to choose which one to be dominant (or stop using FORMAT SQL on the entire script, but just highlight the block where I…
3 votes -
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 -
Multiple format options for insert statements
Currently SQL Prompt only has one option for formatting insert statements which poses a problem for us with multi value set inserts.
Ideally we'd be able to select a formatting for a single value set insert and another format for a multi value set insert.
This would allow us to do something like this:
-- Single Value Set Insert
INSERT INTO TestTable (TestName,
~~~~TestValue,
~~~~TestDate)
VALUES (N'Something',
~~~~140,
~~~~'1/1/2019')-- Multi Value Set Insert
INSERT INTO TestTable (TestName, TestValue, TestDate)
VALUES (N'Something', 140, '1/1/1900'),
~~~~(N'SomethingElse', 150, '1/2/1900'),
~~~~(N'SomethingElse2', 160, '1/2/2000')The issue for us is that we have need of…
10 votes -
Format lists on a clause basis
I would like to control the list behavior on a clause by clause basis so that I can separate the formatting on my DECLARE statements differently than lists within SELECT and INSERT statements. As it stands, these are conflicting changes. So, the only way to get each variable declared on a separate line is to also have every column in other statements on a separate line. I'd like to be able to do BOTH of these:
DECLARE @GUID UNIQUEIDENTIFIER = NEWID(),
@Char CHAR(1) = 'A',
@Int INT = 1,
@Datetime DATETIME = CURRENTTIMESTAMP,
@Decimal DECIMAL(18,10) = 1.0,
@Date DATE…2 votes
- Don't see your idea?