Have a procedure with tons of temp tables you don’t want to keep track of? Or debugging some nasty code with tons of temp tables? This SQL snippet is quite handy. It will drop all the temp tables in your current scope. Enjoy!
SQL cursors are bad, evil, wicked things… a scourge on performance and a pox on the skills of any good SQL author. Any good SQL man worth his salt will scoff indignantly at the mere sight of the CURSOR keyword in any production code. It’s clear to those experts that a set-based operation will always outperform… Read More SQL Cursors are slow… except when they’re not
So, your query looks something like this: Totally safe, right? That check on non-zero TotalQuality values should prevent divide-by-zero errors? Then you run it in production against 100,00 rows and BLAM! Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered. Ye Gods! How could this possibly happen?!? Thousands of years of… Read More Where Clauses Cannot Prevent Divide-by-Zero Errors