|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 9:13 AM
Points: 2,
Visits: 27
|
|
Hello,
Is there a extensible rule-based tool to find problems in SQL Server stored procedures? What I'm looking for is something similar to:
http://www.mono-project.com/Gendarme
...but only for stored procedures instead of .NET app code (in our case VB). We've found Gendarme to be very useful so far and it got me thinking it would be great to have the same capability to analyze stored procedures for bad practices, etc (including any rule we want it to look for per the extensibility).
Thanks, Michael
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 5:41 AM
Points: 11,645,
Visits: 27,740
|
|
not sure about extensibility, but i've seen two tools that look for issues, complexity, and rules for coding; http://sqlcop.lessthandot.com/ http://www.sqlcodeguard.com/
I'm not familiar with either one, but it's a starting point;
Lowell
--There is no spoon, and there's no default ORDER BY in sql server either. Actually, Common Sense is so rare, it should be considered a Superpower. --my son
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 9:13 AM
Points: 2,
Visits: 27
|
|
| Thanks! It looks like SqlCodeGuard is just want I was looking for. Not sure how extensible it is, or if it will be easy to get the results into a database where we can report and track, but it is a great start.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:48 AM
Points: 6,728,
Visits: 11,774
|
|
I demoed Visual Studio features at one point and the rules are extensible.
Create and Register Additional Rules for Analyzing Database Code - Visual Studio 2010
Analyzing Database Code to Improve Code Quality - Visual Studio 2010
Not a lot of shops adopted the database tools integrated in versions of Visual Studio 2010 and before because it was cost prohibitive, instead opting for some combination of SSMS and other tools. The good news is that Microsoft has carried static code analysis forward into SSDT for SQL 2012 which is free I havent demoed it yet though to see how much they brought forward.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, December 12, 2012 7:32 AM
Points: 3,
Visits: 51
|
|
michael_c_leone (8/31/2012) Thanks! It looks like SqlCodeGuard is just want I was looking for. Not sure how extensible it is, or if it will be easy to get the results into a database where we can report and track, but it is a great start. from version 2.1.4628 SqlCodeGuard has an API to incorporate it in your own projects
usage is pretty simple
SqlCodeGuardAPI.API api = new SqlCodeGuardAPI.API(); api.IncludeIssue("ALL"); bool unparsed; List<Issue> l = api.GetIssues(sql, out unparsed); if (unparsed) { Console.WriteLine("Unparsed! Issue list may be incomplete or wrong"); } Console.WriteLine("Issues:"); foreach (Issue i in l) { Console.WriteLine(String.Format("({0}){1} at {2}:{3} ({4})", i.ErrorCode, i.ErrorText, i.Column, i.Line, i.ErrorMessage)); }
|
|
|
|