Anyway, last week, I was troubleshooting a report at work. The report was based in SQL language and had over 22,000 lines of code. Last year the report worked great, this year it kept crashing and actually bringing down the entire server sometimes. I was told that "nothing had changed" on the database side between last year and this year and it must be a probelm with the report. Well, the report hadn't changed either so I went to the SQL to investigate. Unfortunately, I don't have the time to manually check 22,000 lines of SQL. So along comes Notepad ++ with it's compare add-in. It is awesome. The compare add in compares two files together, so I saved down the last years report SQL and this years report SQL to text files and compared them.
The add-in analyzes each line of the text file and shows the files side by side. Any line that is completely different on one side or the other gets highlighted and a line gets inserted in the other file to allow you to keep the matching lines side by side. Any lines that look almost the same get highlighted in a different color with the differences highlighted in a darker shade. All lines that match 100% don't get highlighted. With 22,000 lines of code, after running this add-in it took me about 2 minutes to find the problem. Turns out that "nothing has changed" was not quite 100% accurate. There is a setting called "Full Outer Join" that isn't a good setting to set as a default for the entire database, that somehow changed from last year to this year.
If you are looking for Windows notepad on super steroids, give notepad++ a try.


No comments:
Post a Comment