663 results found
-
Code Analysis EI028 Incorrectly Identified When Adding Not Null Column With Explicitly Defined Default Value
Stop raising EI028 when adding columns using style:
ALTER TABLE dbo.MyTable
ADD TestColumnB CHAR(1) NOT NULL,
CONSTRAINT DFMyTableTestColumnB DEFAULT ('B')
FOR TestColumnB;2 votes -
EI003 to allow variable assignment of MIN and MAX and Scalar-valued function results
At the moment a warning is given "Non-scalar subquery in place of a scalar" when trying to assign a variable to the result of a MIN or MAX query which would only result in a single value. Also get the warning when i create a Scalar valued function and assign variable to result of a call to that. In each of these case only one result can be returned so the warning appears inaccurate and wrapping the result in a TOP 1 { } ORDER BY statement seems an overkill just to remove the warning
2 votes -
Create "declare table" snippets
I am in the process of converting many Stored Procedures to UDFs (for various reasons).
One thing that is irritating is that these SPs often use the SELECT x, y, z INTO #tempTable pattern.
Would that be possible for you to generate the equivalent DECLARE @tempTable TABLE ( x TYPE,y TYPE,z TYPE) statement?
That would have proven to be very helpful!
2 votes -
Intellisense for Linked Server connection to MySQL ODBC
I have been using SQL Prompt for awhile and one of the best feature I like about it is the fact that Intellisense works even on Linked Server to other MSSQL databases.
Recently however, I have set up Linked server to MySQL ODBC connections and I noticed that Intellisense is no longer returning the table names and column names in the predictive boxes.
I then tested this to other ODBC connection. I set up Firebird (DB2) and Oracle and Intellisense seems to be working for these (only for table names, not columns but that's better than nothing).
Is there a…
2 votes -
Align column aliases, but only up to a configurable MAX point
The alias alignment is a nice feature that improves the readability of the formatted SQL. Still, it sometimes gets lost too far to the right when the selected column values include things like SQL functions and column names. In those cases, the alignment of the column aliases can require scrolling to the right to see them with a great amount of whitespace between the column name and the aliases and they thus become a detriment to the readability of the SQL.
It would be great if we could configure a max number of spaces to align the aliases before which…
1 vote -
Add or detect missing 'N' on inline string literals containing Unicode characters
This is an extension of:
https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/6779217-add-n-to-unicode-type-literal-stringsExcept I would like to improve this feature so that it is not limited to just variable declarations, but also for inline string literals.
For example, if an inline string literal contains a unicode character, it should have the N prefix. If anything it should probably be a Code Analysis rule rather than formatting because this change can absolutely impact code behavior. So I think it's better suited to be an analysis rule.
1 vote -
Intellisense for system stored procedure parameter values
For system stored procedures, some parameters have a predefined set of possible values, e.g.
msdb.dbo.sp_add_jobstep
has the parameter@on_success_action
.The MS documentation lists this predefined list of possible values:
1 (Default) Quit with success
2 Quit with failure
3 Go to next step
4 Go to step@on_success_step_id
It would be great if Intellisense could suggest values for these sorts of parameters, saving a trip to Microsoft's website.
1 vote -
sub
I would like to be able to check a box and always indent a sub-query.
currently formatting a query works like this:
SELECT *
FROM dbo.tbl1 AS a
INNER JOIN(SELECT ID FROM dbo.tbl2 WHERE value = 'y') AS b ON a.id = b.idwhen the paren is set to inline the open paren and indent the content with the indent parentheses contents checked. I would rather have a checkbox to force the sub-query to format like this:
SELECT *
FROM dbo.tbl1 AS a
INNER JOIN (
SELECT ID
FROM dbo.tbl2
WHERE value = 'y'
) AS b ON a.id =…1 vote -
Option to display values within IN statements without spaces between them
Another white space removal feature to suggest.
The ability to format all IN statements as:
empType IN ('a','b','c','d')Rather than the default:
empType IN ('a', 'b', 'c', 'd')I have done some exploring in the formatting styles and scouring the forums here and this feature doesn't seem to be available.
1 vote -
Allow indentation similar to nested JOIN when they are not written as nested
A nested join is indented additionally relative to the join that it is nested within:
SELECT *
FROM Person.Address
--INNER JOIN Person.StateProvince
----INNER JOIN Sales.SalesTerritory
------ON SalesTerritory.TerritoryID = StateProvince.TerritoryID
----ON StateProvince.StateProvinceID = Address.StateProvinceIDWhen joining the same tables but not writing them in a nested manner, there is no additional indentation:
SELECT *
FROM Person.Address
--INNER JOIN Person.StateProvince
----ON StateProvince.StateProvinceID = Address.StateProvinceID
--INNER JOIN Sales.SalesTerritory
----ON SalesTerritory.TerritoryID = StateProvince.TerritoryIDIt would be nice to allow the same amount of indentation that would be used if the join were nested to be used when it is not nested:
SELECT *
FROM…1 vote -
Separate VALUES style by first/subsequent
It would be nice to have an option to specify different styles when there is one set of VALUES compared to multiple. For example, I would like to use "Compact, indented) when there are multiple sets of VALUES:
INSERT INTO Employees
( id
, FirstName
, LastName
, BirthDate )
VALUES
( 2
, 'Jane'
, 'Doe'
, GETDATE())
, ( 3
, 'Frederico'
, 'James'
, GETDATE());But compact when there is only one set of VALUES:
INSERT INTO Employees
( id
, FirstName
, LastName
, BirthDate )
VALUES
( 2
, 'Jane'
, 'Doe'
, GETDATE())1 vote -
CTE on new line with commas before items is adding an extra line
When using the Lists > "Place commas before items" combined with the CTE >" Place CTE name on a new line" options, the subsequent CTEs are getting placed on new lines after the comma is already on a new line, resulting in:
WITH
myCte
AS ( SELECT 1 a )
,
mySecondCte
( Col1, Col2 )
AS ( SELECT
'Test' AS ThisIsAColumn
, 'Test2' AS ThisIsAnotherColumn
FROM Person.BusinessEntityContact )
SELECT *
FROM myCteI believe this combination of settings should be resulting in:
WITH
myCte
AS ( SELECT 1 a )
, mySecondCte
( Col1, Col2 )
AS ( SELECT…1 vote -
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 -
One feature idea that I think would be great for many customers. Often I have a pasted column of data from Excel that i need to run a macro
One feature idea that I think would be great for many customers. Often I have a pasted column of data from Excel that i need to run a macro on in Notepad++ to add single quotes and commas. So that I can paste the string into a SQL “in ( ) " clause.
It would be amazing if SQL Prompt had an option to convert that clipboard text right in SSMS. I think lots of people would find that a timesaver.
1 vote -
Make Import / Export of options more flexible (xml file format or enable partial export of sections)
I would like to be able to export (+import) only specific portions of the options.
So that I - for instance - may only distribute my aliases or my coding style options to the team; not everything. The current binary format for the export file only allows for an all-or-nothing approach.
So please
(A) Make the export file a xml-format, so we can filter it ourselves
or
(B) Add a dialog to allow us to mark the sections to be included into the export file via checkboxesThis would also likely solve other feature-requests:
- https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/46784125-export-snippets-to-text-file
- https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/40966285-sql-prompt-setting-sharing
- https://redgate.uservoice.com/forums/94413-sql-prompt/suggestions/39174019-import-and-export-aliases1 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 -
Close pop up windows when holding down the control key while editing sql in SSMS
While editing code in SSMS, i often find I want to use control key navigation (ctrl - left arrow for example) to navigate to a different part of the text i'm editing, but a pop-up intellisense window has arrived and instead of moving to the start of the word i'm editing, its trying to make me choose things from its pop up. It would be nice if ctrl key navigation would auto close the intellisense window so I could continue moving around the text of my query instead of having to hit escape all the time to close the pop…
1 vote -
When setting tab colors, allow/disallow the status bar to mirror the tab color
I am color-blind and while tab coloring isn't as big an issue, the real estate of the status bar and font size makes certain color schemes that I use on tabs VERY difficult to read. I would love an option to select whether the tab color propagates to the status bar and possibly even separately set a different "default" color for the status bar. I know some have requested the status bar mirror the tab color but some of us color-challenged developers would rather not have that option. Note, the "default" color could be consistent across all environments rather than…
1 vote -
IntelliSense for $partition.<partition_functions>
I would like the Prompt to be able to list any partition function found in the current context (DB)
like when i write: $partition.<Intellisense here>1 vote
- Don't see your idea?