669 results found
-
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 -
Custom values for VALUES clause
I write a LOT of unit tests, usually at the rate of 15:1 to 20:1 to my executing code. I have these standardized and templated to make them easier and more consistent to build. e.g. @GUID UNIQUEIDENTIFIER = NEWID(),
@Char CHAR(1) = 'A',
@Int INT = 1,
@Datetime DATETIME = CURRENTTIMESTAMP,
@Decimal DECIMAL(18,10) = 1.0,
@Date DATE = CURRENTTIMESTAMP,
@Time TIME = CURRENT_TIMESTAMP,
@Bit BIT = 1,
@Money MONEY = 1.00,
@Binary VARBINARY(18) = 0x01,These go into my VALUES clause for INSERT statements, but I current have to do all of this manually, which takes a LOT…
2 votes -
Load tabs into prior windows on SSMS startup
Currently I have query tabs in two separate windows within SSMS to view data and queries side by side. After closing and re-opening, it would be great if these segregated tabs went back into their appropriate windows. Along with that, it would be great if it would only load back in the tabs for the server we are connected too. Not also the tabs that I had open in a different instance of SSMS to a different server; which I had displayed on a different monitor for more side by side viewing.
2 votes -
2 votes
-
On-the-fly query keyboard shortcut
Similar to the query shortcuts built into SSMS with the number row...except you can set it on-the-fly, quickly and easily.
I'll let you guys figure out the details if you think it's a good idea. Basically I want the ability to give SQL prompt a query, and say, "please run this every time before running the highlighted query". But the configuration process needs to be FAST and EASY to help with rapid troubleshooting.
This is useful for variable declarations that are at the top of a script, but you need to run another part of a script separately.
1 vote -
Conditional Snippets - Either...logic in the snippet, or logic to decide which snippet to run
I have some snippets that I would like to be server specific. For example, we have two servers, each one has a sort of "support" database, but they do not have the same database name. But both databases have maintenance procs I like to use that do have the same name.
I'd like to have some way of saying "If I am on Server1, then run SnippetA, if I am on Server2 then run SnippetB"
OR
Allow something like this as part of the snippet:
$IF($SERVER$='Server1','String1','String2')$
3 votes -
wrap line at the limit, not at comma
When setting a line wrap at a number of cheracters, I would like to get the line at that long, and then wrapped. Not at the first comma. For example currently I get:
select firstname
, lastname
, email
, phonenumber
, country
, countryalias
, region
, gender... but I want to get:
select firstname, lastname, email, phonenumber, country
, countryalias, region, gender1 vote -
Support a personal library of full queries with named parameters
This idea is kind of between snippets and tab history.
USE CASE
I frequently need to diagnose issues with our data. This typically involves using on of a few dozen queries. Currently each time I need one of these I have to 1) check to see if I have a recent version in tab history; 2) load it from some .sql file I happened to have saved it; or 3) rewrite it from scratch. For 1 and 2 I then have to search for all of the places where I need to replace WHERE expression values with data specific to…1 vote -
Object preview tab size too big - SSMS uses 4 space tab, preview using 8 space tab
When hovering over an object name to view its contents...the tab size used in the code is much larger than what is being used in SSMS. So the formatting of the preview is completely messed up.
Maybe a setting to configure the tab size? Or maybe it can look up what SSMS is using?
1 vote -
Automatically add DROP TABLE IF EXISTS for #temp tables
It would be nice if SQL Prompt had a way to add in the code DROP TABLE IF EXISTS #table for temp tables. Ideally it would add the statement immediately before the table is created from a CREATE TABLE or SELECT INTO statement.
11 votes -
Add option to wrap lines when concatenating strings
Sometimes I set a variable equal to many strings concatenated together using the "+" syntax. When I format with Regdate, there is no option to wrap lines in this case. Everything ends up on the same line as the SET, so the lines often get very wide and go off screen.
It would be great if there was an option to wrap text if things got too wide horizontally.
One solution would be a setting to format concatenated strings like this:
SET @Variable = N'String1'
+ N'String2'
+ N'String3'4 votesHi Amanda,
Would the ‘wrap lines longer than X characters’ option in the formatting styles help with this?
Tim
-
Feature to make variable declarations persistent while testing
Allows you to define (on a per tab/session basis) a list of variables you would like to be declared before running the highlighted piece of SQL.
Reason: I like to put all of my "magic numbers" in variables at the top of the proc. This works great for code readability, but it's a pain to troubleshoot because now everywhere the variable is used, you need to copy that variable declaration above whatever code you are testing in order for it to work.
4 votesThanks for the suggestion Chad. We think this is a nice idea, we’ll wait to see how others in the community comment and vote before taking it forward.
Tim
-
auto complete set proc parameter defaults
when stored procedures have variables with defaults, your auto complete intellisense does not set the default. for example, if the parameter @a is an int = 5 in the creation of the proc, your auto complete says @a = 0 --int
3 votes -
When excluding schema / database from suggestions, if provide excluded schema, suggestions should still appear, but limited to that schema
So i specifically excluded our "temp" schema from my suggestions and it works brilliantly, however, when specifically want that schema, after completing the schema name it should show me the suggestion within that schema? -
Currently my options are to remove the "don't show suggestions" for the temp schema and then add it again after this session.2 votes
- Don't see your idea?