48 results found
-
New Code Analysis Rule: Flag system named constraints
It is generally bad practice to use system named constraints and there should be a rule for flagging them when there is DDL code creating one.
3 votes -
Suggest casting to match data types in joins
In a large query, it can be a hassle to check every join to make sure the data types match up exactly (for example, nvarchar(50) <-> varchar(100)). These differences can have huge impacts on query performance in some circumstances, or lead to confusing results if data types are converted in an unexpected way. A suggestion to call out boolean statements comparing mismatched data types could be extremely useful.
3 votes -
Remove PE019 (Consider using EXISTS instead of IN), or allow it to be disabled
Following the suggestions of rule PE019 (Consider using EXISTS instead of IN) leads to performance issues, by creating correlated subqueries. Even the documentation of the rule admits that there is no longer a performance benefit of doing what is suggested. Please remove the rule or allow the rule to be disabled across a team. At the moment, the disabling of rules is done per developer, and a developer who did not know to switch off this rule, followed the advice, creating a performance problem.
3 votes -
Code Analysis Selection Background Colour
Could we have the ability to change the background colour when Code Analysis detects an issue with the code. My scheme is black background and light coloured fonts. When code analysis detects an issue, the code becomes unreadable. Below has an example:
https://forum.red-gate.com/discussion/86480/code-analysis-selection-background-colour#latest
3 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 -
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 -
"drop user"
Highlight of today was when I ran
DROP USER MyUser
In the wrong (production) database.
Please add a warning to SQL Prompt, like your
"You're about to execute a DELETE statement without a WHERE clause"When you run a DROP USER or a DROP LOGIN statement on a production server. Not only does the user or login disappear, but also all rights granted to the user.
Maybe add the question “are you in the correct database?”
3 votes -
Issue code SC003 when USE is first line
Issue code SC003 shouldn't happen if the USE statement is at the top of a SQL script.
3 votes -
DECIMAL default scale warning in Code Analysis
Would be great if SQL Prompt Code Analysis would give a warning on SQL Below:
SELECT CAST( 1.453 AS DECIMAL)
SELECT CONVERT(DECIMAL, 1.453 )3 votes -
EXEC sp without return (EXEC @Results = sp)
EXEC spwho2 without return (EXEC @Results = spwho2)
Give a warning when tsql or stored procedure has execute a stored procedure without a variable for an error to bubble up to.This is the proper way because ieven in a try catch the Exec sp_who2 won't give and error to stop the tsql from going on
3 votes -
Add rule for deprecated DATABASEPROPERTY
Add rule for deprecated DATABASEPROPERTY
3 votes -
Compare the output and speed of two stored procedures
Add a new window that compares the output (and speed) of two stored procedures using the same parameters (ignoring parameters that are missing on either side).
When fixing performance problems or adding new parameters to existing stored procedures, we often need to rewrite large portions.
After successfully speeding it up, we need to test if the results are still correct.
One way to do this is to compare the output of the new procedure with the output of the old one using different parameters. This involves storing results in temp tables, sorting them, output to a text file and using…2 votes -
Suggest data truncation
Consider I've got a variable of varchar(35)
I perform an update on a column of varchar(10), it should suggest that there will be a truncation
2 votes -
New code analysis rule: predicate data type agreement
Please create a rule that detects when the data type of input parameters, local variables, and/or expressions do not match the data type of the column in a predicate.
For example, if we have
a Person table, with column LastName varchar(60) NOT NULL, and
in the body of a stored procedure which has an input parameter defined as @LastName nvarchar(100)... and a predicate like WHERE Person.LastName = @LastName [join, apply, correlation, and functions also need this]
It would be wonderful - save me massive amounts of time - if SQLPrompt could flag this and help reduce implicit conversions.
Thank you!
2 votes -
Allow Copy/Paste contents of 'List of Code Analysis Issues' window.
Sometimes I would like to just copy/paste the issues discovered and include in an email. Currently, I cannot copy the Issues list. It takes too much time/effort to export to a file and then attach that file to an email. Copy/paste would be so much easier.
2 votes -
Include auto fix for single quote string literals as aliases warning, Issue code: DEP01.
Create auto fix for Issue code: DEP01 non-standard column aliases because of single quote delimiter. Also need to update SQL Format tool, it is currently using single quote and there is no way I could find to switch it to double quote.
2 votes -
2 votes
-
Autofix for existing functionality
There are cases where the code analysis detects errors and where the tool already have functionality to correct the issue. For instance with unqualified column names
2 votes -
DEP026, updated to work with spatial code
w.sysLocationXY.STX, should not generate an code analysis error.
2 votes -
Offline TSQL code analysis and Standardization report..Where we can add custom rules regarding to company naming procedure
My Name is Waleed Abrar and my license number is. I am actively looking of Static TSQL Analysis and I was really happy with the SQL Prompt. I have done some analysis and implemented some test cases. It works really good working live and parallel to development . I want to ask if it’s possible to do an offline analysis and get a HTML or Excel report for a particular database about the TSQL code Quality inside the DB. For Example I can select the Database ‘XYZ’ and then click Analyze static code. It will give me a report back…
2 votes
- Don't see your idea?