Sometimes I find remembering where a particular server sends its backups to a nightmare. You might have servers backing up to different locations, you might have different locations for individual databases and different locations for your fulls, diffs and logs. You might be trying to get your head around a customer's set up, where the... Continue Reading →
Resource Hog! What’s my busiest database?
Image by Belinda Cave from Pixabay Imagine that we're seeing very heavy load on our SQL server, be it CPU or IO and we need to find out which database is the driver. I'm sure we've all been there at some point, sometimes it's easy to tell. We might only have a handful of databases... Continue Reading →
BlitzBlockingChain, Getting Blocking Chains from sp_BlitzWho
Photo by Joey Kyber on Pexels.com I'm going to assume that most people will have at least heard of Brent Ozar's brilliant First Responder Kit. If you haven't then you've been missing out on some serious (and FREE) SQL troubleshooting goodness and I'd suggest you check it out. Now I use these scripts all the... Continue Reading →
Which Processes are waiting on a Spinlock?
Spinlock contention is always a real headache to deal with. I recently saw an issue when spinlock contention on SOS_CACHESTORE was making the server virtually unresponsive. The issue was very intermittent with no obvious pattern but the assumption is that it was caused by a particular process in the application. Finding what that process was... Continue Reading →
External Temp Tables Preventing Plan Reuse in Stored Procedures
Here's an interesting issue that recently came up. We were seeing very high compilations and recompilations on a server to the point that it started causing us some very serious issues (admittedly this wasn't the sole issue but it was certainly a contributing factor, the other factors were also very interesting so I might look... Continue Reading →
My Application is Getting SQL Timeout Errors, But What Query is the Problem?
This is something that comes up time and time again. A developer or member of the service desk comes up to me and says "SQL's timing out, you see what the query is?". Well I'll tell you now that SQL's not timing out your query, SQL will happily run a query for a year and... Continue Reading →
When Read Committed Snapshot Goes Bad – Version Store Filling TempDB
We all had those calls, it's the middle of the night and we get that phone call that a customer is getting error messages due to their tempDB being full. My first step is usually going to be to have a look and see what sessions have allocations in TempDB, we can do that quickly... Continue Reading →
Encryption in SQL Server #1 – Column Level Encryption
For one reason or another data security and encryption has been coming up quite a bit in my day to day work recently and I've started to realise that it seems to be one of those things that people aren't all that aware of. As I've been meaning to write a little series on encryption... Continue Reading →
Generate a Random Number for Each Row in a Query {a better way}
A couple of years ago I wrote a post on how to generate a random number in SQL Server. https://sqlundercover.com/2017/06/22/generating-random-numbers-for-each-row-over-a-specified-range-and-other-funky-stuff-you-can-do-with-them/ It's ok and it works, it's also a method that I used for quite a while. Why not use RAND() I've heard people say, well the issue with RAND() is that it will generate the... Continue Reading →
T-SQL Tuesday #135 – The Tools That Make My Job Awesome!
Blog posts have been few and far between from SQL Undercover lately but what better to try and get us back in the swing again than with T-SQL Tuesday. This month's invitation comes from Mikey Bronowski https://www.bronowski.it/blog/2021/02/t-sql-tuesday-135-the-outstanding-tools-of-the-trade-that-make-your-job-awesome/ There are so many tools that I use day in and day out to make my life easier... Continue Reading →