So I ran into an interesting problem at work today. One of our reports wasn’t showing all of the required locations. One instance turned out to be an error with another one of our systems. The rest led me down a 3 hour rabbit hole.
To start off with, this is the basic gist of the query:
The data we were joining to was on a linked server. For whatever reason when that view on the linked server was right joined it would drop about 380 rows. This is bad because the report we were generating required that there be an entry even if there was no data. Thus the use of right join made sense as it would still generate a record for the specific location but fill it with null data which could be used to display “0” in the report.
For the first hour it boggled me as I tore the original query apart and made the super simplified version above. The next was poking and prodding at the query to see if it was anything with the data. No dice there.
After about two hours I contacted a friend (and some one who had originally written this) for some help/ideas. With his help I managed to find a work around:
So because we querying the table directly provided all the results now I’m querying the data from the local table in the join and then joining on all the data which forces it to get everything properly.
Back in 2013 I wrote a blog post on a fun little Breaking Bad themed clicker game called Clicking Bad. It was an interesting little game. I had found it early in the development and being the mischeviously curious developer that I am I decided to poke around the code. I managed to write my own little “hack” menu for the game which allowed me to add my own values. The developer kept upping the complexity a bit more over time, even adding a little honeypot for anyone who looked at the game object that triggered a “Counterfeit” achievement.Continue reading...