Humor

Why Your Biggest Query Plans Don’t Show Up in Some DMVs

SQL Server has three ways to get execution plans from the plan cache: sys.dm_exec_query_plan – around since SQL Server 2005 sys.dm_exec_text_query_plan – added in 2005 SP2 sys.query_store_plan – new in SQL Server 2016 And there’s an important problem with the first one. To show it, let’s take one of my many bad ideas, building queries that take 12+…
Read More

Bad Idea Jeans: Multiple Index Hints

I hate that you can do this Here’s the thing: I’m mostly writing this because I didn’t know you could do it. But it’s cool, because it’ll reinforce some other concepts, and I’ll show you why you shouldn’t do it. I’m talking, of course, about index hints. To be more specific, hinting multiple indexes on…
Read More

CTEs, Views, and NOLOCK

Humor, SQL Server
12 Comments
This is a post because it surprised me It might also save you some time, if you’re the kind of person who uses NOLOCK everywhere. If you are, you’re welcome. If you’re not, thank you. Funny how that works! I was looking at some code recently, and saw a CTE. No big deal. The syntax…
Read More

Bad Idea Jeans Week: Building a Fork Bomb in SQL Server

Bad Idea Jeans, Humor, SQL Server
14 Comments
Somewhat different than a sex bomb, a fork bomb is a denial-of-service attack that just starts a process that replicates itself, thereby starting more and more processes until the service goes down. Wikipedia’s fork bomb page lists examples on most operating systems (including Windows). I’ve always found fork bombs funny because of their elegant simplicity, so…
Read More

#DellDBADays 2016: What Would You Do with Unlimited Hardware?

Humor
94 Comments
Last August, we got the team together in person for Dell DBA Days. We ran all kinds of interesting experiments with SQL Server, and shared the results with you via live webcasts. https://www.youtube.com/watch?v=Gn43sOLrcVs You can watch our recorded episodes from last year – I’d highly recommend the last one, Watch SQL Server Break and Explode. Erik…
Read More

Creating Tables and Stored Procedures in TempDB – Permanently

No, not #tables – actual tables. Here’s how: Transact-SQL USE tempdb; GO /* This one is only available during my session: */ CREATE TABLE #myTempTable (ID INT IDENTITY(1,1), Stuffing VARCHAR(100)); GO /* This one is global, meaning it's available to other sessions: */ CREATE TABLE ##myTempTable (ID INT IDENTITY(1,1), Stuffing VARCHAR(100)); GO /* You can…
Read More

Microsoft Discontinues SQL Server Support for Windows

Humor
13 Comments
Microsoft announced today that the forthcoming SQL Server 2016 version won’t just run on Linux – it will only run on Linux. Mark Souza, Microsoft “When we started developing the Linux port of SQL Server, we weren’t really serious about it at all,” confessed Mark Souza, lead documentation author for the project. “But after a couple of weeks, we…
Read More