During a recent DR scenario I came across a slight misinterpretation in how availability groups with replicas in synchronous commit behave. How An Availability Group With A Synchronous Secondary Should Behave Under Normal Circumstances Normally, if we've got a secondary replica in synchronous commit mode, our primary can't commit any transactions until that transaction has... Continue Reading →
Happy New Year, Here are our Most Popular Posts of 2018
Firstly, all of us at SQL Undercover would like to wish you a very Happy New Year and all the best for 2019. To sign off for the year, here's a quick run down of the most popular posts from SQL Undercover in 2018. Thanks to everyone who's supported us over the last 12 months.... Continue Reading →
Quickly Compare Data in Two Tables Using CHECKSUM and CHECKSUM_AGG
There are times when we need to compare two tables and figure out if the data matches. I often see a number of ways of doing this suggested, most are quite slow and inefficient. I'd quite like to share a quick and slightly dirty way of doing this using the CHECKSUM and CHECKSUM_AGG functions. CHECKSUM()Just... Continue Reading →
Managing Logins and Users Across An Availability Group
What's the deal with logins and availability groups? I'm sure that we all, when creating a login that accesses a database that happens to be part of an availability group, diligently go and create that login on all secondary replicas, don't we?! Of course, when that AG fails over to another replica, we want to... 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 →
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 →
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 →
TSQL Tuesday #106: Triggers and the Spiral To Oblivion
It's the second Tuesday of the month which must mean only one thing... We're all skint and payday feels like a long way off??? Not quite, well maybe... but it's also T SQL Tuesday! This month's invitation comes from Steve Jones and he's asking us to write about triggers and our experiences of them. So...... Continue Reading →
