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
Did you know that ADO.Net leaks isolation levels across pooled connections? This is particularly bad if you’re trying to use Snapshot isolation in SQL Server 2005+. So, let’s say you create an ADO.NET connection (say, from Entity Framework) and do an update… you’re fierce about your data integrity, so you set your isolation level to Serializable…… Read More ADO.Net Leaks Isolation levels across pooled connections