Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Jesse McLain
»
Comparing Stored Procedures, Part 2
Comparing Stored Procedures, Part 2
Rate Topic
Display Mode
Topic Options
Author
Message
Jesse McLain
Jesse McLain
Posted Thursday, February 19, 2009 6:15 AM
Old Hand
Group: General Forum Members
Last Login: Monday, May 06, 2013 8:47 AM
Points: 304,
Visits: 552
Comments posted to this topic are about the item
Comparing Stored Procedures, Part 2
Jesse McLain
jesse@jessemclain.com
www.jessemclain.com
www.jessesql.blogspot.com
Post #660220
Brett Phipps
Brett Phipps
Posted Tuesday, March 29, 2011 9:36 AM
SSC Journeyman
Group: General Forum Members
Last Login: Tuesday, June 04, 2013 8:08 AM
Points: 94,
Visits: 212
This is a reinvention of the wheel. There are a number of products that can do file comparisons and would've taken a lot less time to aquire and use than you spent writing this frivilous code.
If you billed this out to a client you should be ashamed of yourself.
Why was this a featured script on the SQLServerCentral daily newsletter as this definitely would not be a good practice to write sql to do a file comparison like this.
Post #1085649
YSLGuru
YSLGuru
Posted Tuesday, March 29, 2011 12:16 PM
SSC Eights!
Group: General Forum Members
Last Login: 2 days ago @ 2:54 PM
Points: 855,
Visits: 1,465
bphipps-931675 (3/29/2011)
This is a reinvention of the wheel. There are a number of products that can do file comparisons and would've taken a lot less time to aquire and use than you spent writing this frivilous code.
If you billed this out to a client you should be ashamed of yourself.
Why was this a featured script on the SQLServerCentral daily newsletter as this definitely would not be a good practice to write sql to do a file comparison like this.
Did you read the thing? Its a comparison between 2 stored procedures and not 2 actual files. Thats not to say that there aren't products out there that can compare STORED PROCEDURES but your post reads like you have inteprted this as comaprison of 2 files outside the database.
Kindest Regards,
A Democracy works great until the day you find yourself on the sheep side of a vote between 5 wolves and 4 sheep on what’s for dinner when neither have eaten in many days. A free Republic where the rights of the few and the individual are protected is the only one in which Freedom and Prosperity for all have a chance to blossom.
Post #1085772
Jesse McLain
Jesse McLain
Posted Friday, April 08, 2011 8:23 AM
Old Hand
Group: General Forum Members
Last Login: Monday, May 06, 2013 8:47 AM
Points: 304,
Visits: 552
I started this exercise because I found it intellectually interesting. It stemmed from a task for a client, but of course this extended exercise I did on my own time. Although it's easy enough to take something like Windiff (which is usually included with Visual Studio), and view a line-by-line comparison of two sequences (in this case lines of code in a stored procedure), I also wanted some sort of quantifiable measure of comparison (e.g., the ability to say that these two sprocs are 87% the same). But more than anything, I was just curious about how such a process works.
That being said, this code could form the basis for a whole host of problems. For example, if you wanted to compare term papers submitted by college students to determine who is cheating, this code could be used for such a purpose. If you attacked the problem using a text comparer (like Windiff), you might have to look at every paper against every other paper (across the history of the class). But a process such as mine would allow you to narrow down the necessary manual comparisons. You could examine only papers with at least 3 matching subsequences of length 10, for example.
Jesse McLain
jesse@jessemclain.com
www.jessemclain.com
www.jessesql.blogspot.com
Post #1090676
Brett Phipps
Brett Phipps
Posted Friday, April 08, 2011 10:12 AM
SSC Journeyman
Group: General Forum Members
Last Login: Tuesday, June 04, 2013 8:08 AM
Points: 94,
Visits: 212
Yes, I read a large part of it, until I got to the point of "this makes no sense to do this when I would've already accomplished the objective before I finished reading this article." I understand that he is comparing stored procedures, but we store all of our stored procedures scripts as text files as save them in subversion. The process of saving any stored procedure as a text file is a 10 second task, so do it programmatically makes very little sense.
As for checking term papers, that sounds like a great idea, but that is not what you started out with or even suggested as a usage to begin with. Moreover, that's a different step altogether, because term papers are not stored procedures, and you would then have to load them into a database and I suspect there would be a lot of other items that would be different as well.
Post #1090770
Jesse McLain
Jesse McLain
Posted Friday, April 08, 2011 7:34 PM
Old Hand
Group: General Forum Members
Last Login: Monday, May 06, 2013 8:47 AM
Points: 304,
Visits: 552
There are two advantages to comparing code programmatically versus manually: quantifiable results and the ability to automatically compare every stored procedure in a database to every other one. Imagine consulting on a project with a database with hundreds of stored procedures, and the manager who brought you in tasks you with reducing the redundancy in those stored procedures. Manually comparing them would take forever, and still not yield the best results.
The point of bringing up the example of comparing term papers was just to show that this code for comparing sequences is easily generalizable. The items in the sequence could be anything - lines of code, words in a term paper, or base pairs of DNA.
Jesse McLain
jesse@jessemclain.com
www.jessemclain.com
www.jessesql.blogspot.com
Post #1091017
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.