SQL Server

Stored Procedure Cached Time vs SQL Statement Cached Time

SQL Server
3 Comments
I recently ran into a performance problem that had me scratching my head. How could a stored procedure’s plan have changed, and yet it not be reflected in sys.dm_exec_procedure_stats? So here’s what happened and what I knew: 7:45am: Users were complaining that a page was timing out 8:00am: Developer emailed the offending stored procedure and input parameter…
Read More

New York City: The Data That Never Sleeps

SQL Server
4 Comments
I love living in the city Blog posts about people’s favorite data sets seem to be popular these days, so I’m throwing my hat in the ring. NYC has been collecting all sorts of data from all sorts of sources. There’s some really interesting stuff in here. Another personal favorite of mine is MTA turnstile…
Read More

When Shrinking Tempdb Just Won’t Shrink

SQL Server, TempDB
71 Comments
I am not a proponent of shrinking databases, but sometimes you have to because your momma said to. Sometimes that database is tempdb. It used to be that we were warned against shrinking tempdb because it could cause corruption, so your only recourse was to restart the SQL Server service. Paul Randal let us know…
Read More

SQL Server Agent is an application server.

SQL Server
16 Comments
Application server. SQL Server Agent is a job scheduler. When we first get started managing SQL Server, we usually use it for backups, index maintenance, DBCC CHECKDB, and other common maintenance tasks. And then one day, we say, “Hey, I need this T-SQL script to run once a day.” We add an Agent job for it.…
Read More

What Is a Staging Environment and How Do You Build One?

Architecture, SQL Server
4 Comments
If you’re a full time production database administrator, you need a staging environment. This is where you test infrastructure tasks like failing over mirroring, doing a disaster recovery role swap, cluster quorum changes, log shipping configuration, and patching. You need to test this stuff repeatedly so that when you’re under pressure in the production environment, you…
Read More

How to Talk People Out of the SA Account, Option 1

SQL Server
29 Comments
So you’ve got a bunch of people using the SA account all over the place. It’s hard-coded into connection strings, embedded in linked servers, and the password is on post-it notes throughout the data center. Step 1: Create an alternative SA account. In a perfect world, you’d create a minimally-privileged AD login that only has…
Read More

sp_Blitz® v44: Reorganized and Reprioritized Results.

SQL Server
25 Comments
Angie Walker, our new Triage Specialist, had the fun experience of sitting in and watching several of our SQL Critical Care® engagements. When I asked her if she noticed any patterns or ways we could improve, she said, “The order of sp_Blitz’s output needs to be reworked for 2016. There’s some stuff at the top that isn’t really high-priority…
Read More

Still Serial After All These Years

SQL Server
30 Comments
With each new version of SQL comes a slew of new stuff While some changes are cosmetic, others bewildering, and the rest falling somewhere between “who cares about JSON?” and “OH MY GOD TAKE MY MONEY!”, but not really my money, because I only buy developer edition. Aaron Bertrand has done a better job finding,…
Read More