Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

T-SQL Code Analysis Tools Expand / Collapse
Author
Message
Posted Thursday, January 9, 2014 5:52 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, December 23, 2014 10:47 AM
Points: 619, Visits: 390
I am researching T-SQL Code Analysis tools, like the equivalent of an FxCop for T-SQL that will scan thousands of lines of stored procedures and views in a database and tell you when you're heading down a dangerous path. (SELECT *, nested views, cursors, etc.)

Since we are looking to start fully using SQL Source Control from RedGate, this would ideally be a tool that integrates with Management Studio rather than BIDS/SSDT. We already have SQL Prompt, so there seems to be some overlap of features, but asking Grant Fritchey on Twitter yesterday it sounds like nothing from RedGate will do strict code analysis.

It looks like if you are using Visual Studio Database Projects, you have a built-in option:
http://msdn.microsoft.com/en-us/library/dd172133(v=vs.100).aspx

But this tool appears to stay fully within the SSMS environment:
http://www.ubitsoft.com/products/sqlenlight/index.php

Is anyone aware of any others, or has any experiences to share when doing Code Analysis in T-SQL?
Post #1529298
Posted Friday, January 10, 2014 7:18 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, December 23, 2014 10:47 AM
Points: 619, Visits: 390
Thanks to last night's DC PASS meeting I have learned there's at least another option:

SQL Cop: http://sqlcop.lessthandot.com/detectedissues.php

But it sounds like not many people are doing this. I thought I would document this in case anyone else in the future is searching for info on code analysis.
Post #1529787
Posted Thursday, January 23, 2014 8:41 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 5,317, Visits: 12,363
I have just downloaded SQLEnlight and started evaluating it and would be interested to hear any other comments about this product. My intention is to use it primarily for static code analysis (my role is one of QA).

My initial impressions:

1) There are spelling mistakes all over the error messages - this creates a poor first impression.
2) Analyses of DBs is quite a bit slower than analyses of .sql files.
3) Building your own rules looks a bit complex (though I haven't yet tried too hard, maybe I'm wrong).
4) The XML output report takes a bit of time to get to grips with (but I've managed to use QlikView to make some sense of it).
5) The command-line options offer great potential for continuous integration - just need to work out exactly which rules are most important and how to integrate the product into our workflow.




Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1534141
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse