For some reason I have always written my Case statements using the following logic: It wasn't until recently that I noticed that there is another syntax that can be used with the CASE expression, the interesting part about this other form is that it is rather aesthetically pleasing when dealing with multiple WHEN clauses... Continue Reading →
High CPU and Query Store, A Story of Spinlock Heartache
This is going to be a quick look at an issue that we recently encountered, I'm not going to go in depth into spinlocks and what they are (perhaps that could be the subject of a future post). We were enjoying a nice peaceful afternoon when we hear panicked shouting that a SQL Server had... Continue Reading →
T-SQL Tuesday – Non-SQL Server Technologies
So, this month's T-SQL Tuesday topic is to think about a non-SQL Server technology that we want to learn. For me, I'm going to pick machine learning. As a DBA, I've always looked at machine learning as a thing for the BI guys. I'm a DBA after all why do I care about that? Well,... Continue Reading →
Signing Stored Procedures That Access Multiple Databases
A while back I wrote a post, Digitally Signing a Stored Procedure To Allow It To Run With Elevated Permissions Recently Manish Kumar asked an interesting question, what do you do if your proc accesses multiple or even all the databases on the server? So, instead of giving him a fuzzy answer in reply, I thought... Continue Reading →
Identifying delays between SQL calls using SQL profiler
One of the common goto methods for query specific slowness which can be replicated via an application can be to start up a trace or extended events session whilst replicating the issue, we all know about the dangers of running these sessions without sufficient filtering so ensuring that correct filtering is applied and sessions are... Continue Reading →
A Play Around With Table Variable Deferred Compilation in SQL 2019
Table variables, they're nasty, dirty little things that perform about as well as a Robin Reliant in a crosswind, right? Well you're not going to have me argue with you there. But how many of us have got these little beasts floating around in their production code with absolutely nothing that we can do about... Continue Reading →
Inspector V1.2 now available
It has been long overdue but finally V1.2 is now available on GitHub. V1.2 brings a lot of changes, We put together a sample report for you to play with but here is an overview of what has been added. Enhancements: #9 Long running transactions module added - A new setting has been added to [Inspector].[Settings]. This setting... Continue Reading →
Inspector revised installation guide
Pre-requisites: SQL 2012 or higher SQL Server Agent A database to store the the data collected by the agent jobs (this can be one you use for your other DBA needs it doesn’t have to be a dedicated database) Optional: For instances with availability groups where you take backups on the secondary replicas you will... Continue Reading →
The SQL Agents’ view of SQL Server
I recently came across a really odd issue with the SQL Agent, there were two agent jobs attached to one schedule one of the jobs was enabled and the other was not enabled - all pretty normal at this point but here is where it got weird. The disabled job was running on schedule regardless!... Continue Reading →
sp_translate, A Universal Translator in SQL Server. Just One Example Of How Powerful the Python/SQL Partnership Can Be.
In my recent post, Installing External Modules into SQL Server’s Python I had a look at just how simple it is to import external modules into Python so that they can be used within SQL Server. In this post I'd like to show you a little something to demonstrate how we can integrate one of these modules... Continue Reading →
