Comments
10 comments
-
Hi Jamie.
I'm giving this a go now.
I cant seem to find how to switch on the 'Issue Details' pane as shown in the screenshot above?
Any suggestions?
I'm using SSMS 2012.
cheers
Ben
Microsoft SQL Server Management Studio 11.0.3000.0
-
Sorry, i've just found it. Click on the green underlined keyword (don't just mouse-over) and press control.
new functionality looks good -
Just installed it. Will let you know what I think.
-
A couple of comments about the new Code Analysis.
- Seems to work pretty well, but when there is code analysis message, it keeps the normal SQLPrompt Intellisense pop-ups from working. So if you use a stored procedure and violate the named parameter use rule you can't get the definition of the stored procedure.
- The "Schema name for table or view is not specified" rule should not apply to temp tables. It looks like this is only an issue if you add an index to a temp table the index definition violates the rule. Like this:
CREATE TABLE #test(colA CHAR(1) NOT NULL, colB CHAR(1) NOT NULL);
CREATE NONCLUSTERED INDEX IX_test ON #test (colA);
SELECT T.colA, T.colB FROM #test AS T
-
Thanks Jack, i'll pass that on to the team.
-
Awesome update.
-
Is there any more documentation or supporting articles for rule SC003 - There should be no USE statement in batch?
I understand flagging context switching and USE statements in the middle of a batch, but it also gets flagged when it's the first statement and only used at the beginning of a script. Including this has saved me a bunch of times, so I want to understand why this is discouraged.
Thanks! -
This looks really neat. Can't wait to give it a try!
-
Hi Cathrine
We don't have anything further on file at the moment, so we've asked Oleksii (SQL Code Guard creator) if he can provide some more info - will send on when we get a reply.
Thanks
Jamie -
Further to the above, here's what Oleksii says:
"The primary reason for such rule is to avoid hardcoded (specific) database name - i assume that each SQL script will be run under context of previously selected database.
"E.g. - when installing any product which requires database, at the very first step you enter database name and later installation package will create database with custom name you entered and run script within this database.
"If (for some reason) you've left with something like "USE MyTestDatabase" in your script then the whole installation will fail (this is bad but not fatal) or you may occasionally change the database context to another existing database.
"So i think this is not so good to have USE in script file."
Let me know if that helps or if you need further info.
Thanks
Jamie
Add comment
Please sign in to leave a comment.
I am delighted to announce you can all now upgrade to SQL Prompt 9 and try out the new code analysis features we have added.
What's new
Over the last few months the development team have been hard at work implementing many of the rules and features from SQL Code Guard into SQL Prompt.
We are launching with over 80 rules, that get displayed as a green line under any issues in your code as you type. You can then hover over that piece of code for a quick tip, or click on the lightbulb icon that appears to the left of your code when you click on it to bring up the "Issue Details" panel.
The issue details panel contains further details, a link to online documentation and a button to disable that rule.
Finally we've added a new Code Analysis options section, that you can access from the SQL Prompt menu in SSMS and Visual Studio. Here you can see all the rules that are available and turn them on and off as required.
Marketing
We will begin marketing SQL Prompt 9 from Friday December 1st, so please share articles, tweets, videos and more as you see them.
What's next for code analysis in SQL Prompt
Over the coming weeks the team will continue to add rules from SQL Code Guard until we have parity.
After that they will be researching and prioritizing improvements. These could include quick fix buttons (to instantly make changes to code issues based on the suggestion), extended rule options, different ways of navigating through issues, and other suggestions we may receive through UserVoice or the forums.
If you have any comments or suggestions please let us know.
We hope you enjoy this latest release of SQL Prompt 9.
Many thanks
Jamie