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

Extensible rule-based tool to find problems in stored procedures? Expand / Collapse
Author
Message
Posted Friday, August 31, 2012 11:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 21, 2013 8:23 AM
Points: 2, Visits: 34
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
Post #1353029
Posted Friday, August 31, 2012 12:05 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:22 PM
Points: 12,890, Visits: 31,849
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
Post #1353032
Posted Friday, August 31, 2012 1:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 21, 2013 8:23 AM
Points: 2, Visits: 34
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.
Post #1353069
Posted Friday, August 31, 2012 7:56 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:45 PM
Points: 7,094, Visits: 12,582
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
Post #1353119
Posted Sunday, September 2, 2012 1:53 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 2:21 AM
Points: 3, Visits: 76
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));
}
Post #1353274
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse