Blogs

Checking for the Existence of Global Temp Table in TSQL

Checking for the Existence of Global Temp Table in TSQL

By Kendra Little on May 3, 2017 • 1 min read

Every now and again, I need use a global temporary table for some testing or demo code.

Each time I do, I stumble a little bit when it comes to checking for the existence of the global temp table, in order to make my code re-runnable.

Continue reading

Use Report View in Perfmon to Compare Database Counters (free video)

Use Report View in Perfmon to Compare Database Counters (free video)

on May 1, 2017 • 1 min read

Category: perfmon , sql-server

Sometimes you need to compare lots of counters at once - for example, counters that report at the database level. This can be frustrating in “Line” view, but the “Report” view in perfmon makes life much simpler.

Continue reading

How Does a DBA Build Confidence After Making Mistakes? (Dear SQL DBA Episode 40)

How Does a DBA Build Confidence After Making Mistakes? (Dear SQL DBA Episode 40)

on April 27, 2017 • 1 min read

Ever had a database change go horribly wrong? It can feel awful in the moment, then eat away at your confidence for days afterward.

In this 20 minute episode, I give you practical steps that help you cope with change over the course of your DBA career.

Continue reading

Error 1204: When SQL Server Runs Out of Locks

Error 1204: When SQL Server Runs Out of Locks

By Kendra Little on April 26, 2017 • 3 min read

I recently did a Dear SQL DBA episode answering a question about lock timeouts and memory in SQL Server. I really enjoyed the episode, and thought it would be fun to follow up and show what it looks like if SQL Server doesn’t have enough memory to allocate locks.

Continue reading

Run perfmon.exe /sys to Remember Your Counters in Windows Perfmon (free video)

Run perfmon.exe /sys to Remember Your Counters in Windows Perfmon (free video)

on April 24, 2017 • 1 min read

Category: perfmon , sql-server

The problem: by default, the Performance Monitor application in Windows doesn’t remember which counters you like to use.

This can mean a lot of clicking every single time you open perfmon.

Continue reading

Are Bad Statistics Making My Query Slow? (Dear SQL DBA Episode 39)

Are Bad Statistics Making My Query Slow? (Dear SQL DBA Episode 39)

By Kendra Little on April 20, 2017 • 1 min read

An important query is suddenly slow. Is it because statistics are out of date? This is tricky to figure out, and updating statistics right away can make troubleshooting even harder. Learn how to use query execution plans to get to the heart of the question and find out if stats are really your problem, or if it’s something else.

In this 35 minute episode:

  • 00:39 SQL Server 2017 Announced
  • 01:10 New video from Microsoft’s Joe Sack demonstrating Adaptive Query Processing
  • 03:05 This week’s question: Are bad stats making my query slow?
  • 05:26 Demo of finding plan in cache and analyzing stats begins
  • 28:17 What to do when stats ARE the problem

Code samples are at the bottom of the page

Continue reading

Trace Flag 4199: No Per-Session Override if You Enable it Globally

Trace Flag 4199: No Per-Session Override if You Enable it Globally

on April 19, 2017 • 2 min read

You can enable and disable trace flags either globally or per-session in SQL Server.

This makes it seem like perhaps if you enable optimization trace flag 4199 globally for all sessions, you might be able to disable it per-session.

But that’s NOT how it works.

Continue reading