662 results found
-
"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 -
compare datatypes in stored procedure calls with defined variables
When I call a stored procedure, I want SQL Prompt's code analysis rules to be able to tell me if the variables I am passing to the stored procedure are OK.
For example, if I pass a bigint variable to a SP that has a tinyint input parameter, I want SQL prompt to flag that as a potential issue.
Similarly, if I am passing a string variable defined locally as nvarchar(150) to a SP that takes only nvarchar(100), it should be flagged as an issue (because I am passing a string that may not "fit" into the input parameter).
3 votes -
Recently Used Suggestions
Love the Recently Used Suggestions feature. It's like it's reading my mind and is a definite time saver.
1 vote -
Recently Used Suggestions
Love the Recently Used Suggestions feature. It's like it's reading my mind and is a definite time saver.
1 vote -
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 -
Tab History Add MRS
sometimes I need same string between different tabs in Tab History. each time I need to copy/paste the desired string. Would be nice if it would remember the most recent used searches same way as any Search box
2 votes -
Is there a way to run your code analysis rules against an existing database?
To help our developers we - as dba's - perform validation against their procedures and database code. The library of rules that is incorporated in SQLPrompt could be a good rule of thumb for the basic stuff of reviewing, so that we can focus on other stuff when validating.
Is it possible to run the rules "engine" of SQLPrompt against an existing database without having to open the code manually?3 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 -
insert default default values should just use SQL Server defaults
When the option to insert a values clause with default values for an INSERT statement is in force, the default values used by SQL prompt ignore nulls. e..g if your table is CREATE TABLE foo (bar int NULL) and you let SQL Prompt build an INSERT with default values, it uses 0 as the default for column bar. This is wrong. The true default is NULL. It would be better if SQL Prompt just used a value clause like :
VALUES (DEFAULT)
and let SQL Server figure out the default. Worse yet, check out this table and the generated code:
…
3 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 -
Show last known value of T-SQL variables in pop-up definition
If I declare variables and assign them values (either in declaration or subsequent SET/SELECT statement, it would be very helpful if SQL Prompt, along with displaying the declaration (e.g. @MyVar int (Scalar variable) in the pop-up, would display the last know value. So, if my declaration was:
DECLARE @MyVar INT = 123
the popup would show something like @MyVar int = 123 (Scalar variable).
I realize some might be rather long (string) or not displayable at all (e.g. table variables, cursors, etc.) but what appropriate showing the value that was set and last known could be very helpful in line…2 votes -
Please allow CASE statements to start on their own line, preferably indented from the line before.
Please allow CASE statements to start on their own line, preferably indented from the line before, rather than starting way, way off to the right when there's a significant amount of stuff before them. Nested CASE statements are nearly unreadable when they're so far off the screen, for complex or nested statements.
This is a pretty simple example, but I've got real ones where the WHEN is so far over I can't even tell it's there without scrolling.
SELECT
CASE
WHEN @SPID = 3 THEN 'th'
WHEN @spid = 88 THEN 'bobasdlkfjalk;sdfjalks;djfla;skjfdlkasfjlks' + CASE
WHEN @SERVERNAME = 'bb' THEN 'a'…6 votes -
Add option to ignore is_ms_shipped flag in suggestion list
When typing a snippet eg I type zcod I get 3 suggestions - but the top one is a merge replication conflict table definition for MSmergeConflictZZZFULLZZZcodt and the 2 below it are my own snippets starting with zcod
I don't understand why this is the case, my own suggestions that START with zcod should take precedence over an isms_shipped table that ends in zcod surely.
I see you recently added (I am on 9.5.11) ordering based on frequency and I never click this table as it serves no purpose so I cannot understand the behaviour.2 votes -
Provide optional colors for Warnings & Highlighting > highlighting
Options, Warnings & Highlighting, Highlighting. The light gray does not work well on a black background. I'd like to be able to select another color for that feature.
2 votes -
Vertically align option for concatenated strings
When concatenating strings, it'd be nice to be able to align the "+" sign. The following is what I get now:
SELECT CASE
WHEN Col = 1
THEN 'Col 1'
ELSE ''
END + CASE
WHEN Col = 2
THEN 'Col 2'
ELSE ''
END + CASE
WHEN Col = 3
THEN 'Col 3'
ELSE ''
END + CASE
WHEN Col = 4
THEN 'Col 4'
ELSE ''
END AS ConcatStr
FROM #Test;But what I'd like to get is:
SELECT CASE
WHEN Col = 1
THEN 'Col 1'
ELSE ''
END
+ CASE
WHEN Col = 2
THEN 'Col…2 votes -
Implement all of the Find Unused Variables and Parameters functionality in Code Analysis
Currently Code Analysis does not implement all of the items that Find Unused Variables and Parameters does.
Specifically I know it's missing:
- Declared variables that are used before a value is assigned
- Assigned values that are never usedEx.
With this code:DECLARE @Test NVARCHAR(1)
DECLARE @Test2 INT
DECLARE @Test3 DATESET @Test = 1
SET @Test = N'Test' + @Test2
Code Analysis will flag the DECLARE for @Test for having a NVARCHAR of size 1 and @Test3 for not being used, but it will not flag @Test2 for being used before a value is assigned to it…
6 votes -
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?