SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

SQL Undercover

David Fowler and Adrian Buckman, two database nerds who love nothing more than to spend their time, reading about, researching and sharing all things SQL Server. David is a DBA with over 15 years production experience of SQL Server, from version 6.5 through to 2016. He has worked in a number of different settings and is currently the technical lead at one of the largest software companies in the UK. After working in the motor trade for over 11 years Adrian decided to give it all up to persue a dream of working in I.T. Adrian has over 3 years of experience working with SQL server and loves all things SQL, Adrian currently works as a Database Administrator for one of the UK’s Largest Software Companies.

T-SQL Tuesday #101 – My day of Essential SQL Server tools.

This month’s T-SQL Tuesday is brought to you by Jens Bestergaard – the subject is Essential SQL Server tools, the original invitation can be found here.


Here is how my day of using SQL tools went:

It all started at 00:00 this morning with planned maintenance, I was… Read more

0 comments, 839 reads

Posted in SQL Undercover on 10 April 2018

Encrypting SQL Server Database Backups

We all go to great lengths to make sure that our databases are secure (or at least I really hope that we do), we make sure that only authorised users have access and then only to the databases and levels that they need.  We’re careful that all our passwords conform… Read more

2 comments, 1,919 reads

Posted in SQL Undercover on 4 April 2018

‘Object Reference Not Set to an Instance of an Object’ When Failing Over an Availability Group Using SSMS <= 17.5

Here’s a quickie that I’ve just stumbled across.

I’ve just tried to initiate a manual failover of an availability group and received the following error.

After a spot of head scratching and thinking that there was something wrong with my AG setup, it turns out that there’s a bug in… Read more

0 comments, 157 reads

Posted in SQL Undercover on 29 March 2018

TempDB Filling Up On Secondary Replicas

Have you ever had an issue where TempDB was filling up on your secondary replicas?  Do those secondaries happen to be read only replicas?

When I have an issue with tempdb filling up the first thing that I usually do is try to figure out exactly what the space has… Read more

2 comments, 2,939 reads

Posted in SQL Undercover on 21 March 2018

TSQL Tuesday #100: A Look To The Future

So for this month’s TSQL Tuesday, Adam Mechanic has asked us to take a look into the future and think about what things might look like when TSQL Tuesday #200 comes around (apparently that’ll be June 2026).  So I thought I’d have a little bit of fun with this… Read more

0 comments, 224 reads

Posted in SQL Undercover on 13 March 2018

What if it all grows out?!

The other day I got thinking about what would happen if all databases on a single instance grew out, every single one of them! but not just once, what if they all grew out three, four or fives times overnight – what would things look like?

Well I know the… Read more

1 comments, 120 reads

Posted in SQL Undercover on 12 March 2018


Here’s a quick one for you.  If you happen to be managing SQL Servers with a large number of databases and availability groups, it can sometimes be difficult to keep track of which database belongs to which availability group.

sp_WhatsMyAG will tell you just that.  You can either provide it… Read more

1 comments, 168 reads

Posted in SQL Undercover on 7 March 2018

Log Shipping – Error: Failed to update database “DATABASE NAME” because the database is read-only

Here’s a strange one that I’ve recently come across.  I had a customer report that their log shipping restore jobs were chock a block of errors.  Now, the logs seem to have been restoring just fine but before every restore attempt, the job is reporting the error,

Error: Failed to… Read more

1 comments, 210 reads

Posted in SQL Undercover on 22 February 2018

Getting started with the SQLUndercover Inspector

Here is a quick guide to getting started with the SQLUndercover Inspector.


  • 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…

Read more

2 comments, 183 reads

Posted in SQL Undercover on 19 February 2018

T-SQL Tuesday #99 : Getting Decked Out in Rubber and Lycra, My Non-techy Passion #TSQL2sday

So this month’s T-SQL Tuesday invitation comes from Aaron Bertrand.  It’s a non-technical post this month as he asks us to write about a non-SQL or tech related passion.

For me, my passion is Triathlon.  I first got hooked on the sport back in around 1998 when I got into… Read more

2 comments, 637 reads

Posted in SQL Undercover on 13 February 2018

The SQLUndercover Inspector is now available!

The SQLUndercover Inspector is now available on GitHub, a quick run down of what it does can be found here: Introducing: The SQLUndercover Inspector, a quick video introduction can be found here and upcoming video tutorials will be released on Undercover TV in due course.

Thanks for reading… Read more

0 comments, 843 reads

Posted in SQL Undercover on 11 February 2018

sp_AGReconfigure 1.1 is now available

sp_AGReconfigure 1.1 is now available HERE and on GitHub

V1.1 includes a new Parameter and some minor bug fixes:


NULL – DEFAULT:  Ignore Readable secondary check (acts as though you are using V1)

0 – Produce a statement to switch readable secondary off if switched on

1 – Produce… Read more

1 comments, 235 reads

Posted in SQL Undercover on 8 February 2018

UNDERCOVER TOOLBOX: Get Details of All Open Transactions

It was 3am in the morning and I was asleep and enjoying a delightful dream (I knew it was a dream because I was surrounded by drifting clouds, singing angels and hundreds of softly humming SQL Servers where the hardware had been sensibly provisioned and all code carefully optimised) when… Read more

6 comments, 293 reads

Posted in SQL Undercover on 7 February 2018

Undercover TV – We’ve got a YouTube channel!

We’ve now got ourselves a shiny new YouTube channel at UndercoverTV.

We’ll be using this to host our monthly podcasts as well as the occasional tutorial video and anything else that we might decide to throw together, so pop over there, subscribe and watch out for new content as it… Read more

0 comments, 250 reads

Posted in SQL Undercover on 1 February 2018

sp_RestoreScript 1.2 is now available

sp_RestoreScript 1.2 is now available HERE and on GitHub

Changes include Service Broker options and the ability to restore a database in stand by, along with a couple of bug fixes.

Read more

0 comments, 369 reads

Posted in SQL Undercover on 30 January 2018

SQL Undercover Podcast – Feb 2018

The first SQL Undercover podcast where Adrian introduces the Undercover Inspector, David releases sp_restorescript 1.2 along with a bit of nonsense chit chat.

Read more

0 comments, 200 reads

Posted in SQL Undercover on 29 January 2018

Creating a SQL Server Test Lab On Your Workstation – Part Three, Creating a Windows Failover Cluster and a SQL Server Availability Group

Welcome along to the third part of our series ‘Creating a SQL Server Test Lab On Your Workstation’.  If you’ve followed along with the first two parts, you should have a domain setup and a SQL Server joined to it.  In this part, we’re going to look at building a… Read more

3 comments, 1,750 reads

Posted in SQL Undercover on 24 January 2018

Introducing: The SQLUndercover Inspector

Introducing: The SQLUndercover Inspector! Finally we have a V1 almost ready to hit our GitHub but what exactly is it?


Just another Monitoring tool? well not quite, the SQLUndercover Inspector is not really a Monitoring tool as such, parts of the Inspector can be used in this way if… Read more

4 comments, 278 reads

Posted in SQL Undercover on 22 January 2018

All Scripts Now On Github

@adedba Adrian Buckman has been working hard and has put all of our scripts up on Github https://github.com/SQLUndercover/UndercoverToolbox

Read more

0 comments, 253 reads

Posted in SQL Undercover on 18 January 2018

Dissecting SQL Server, The Internal Structure of a Row

I’m sure that most of us know that SQL Server stores all it’s data in 8Kb pages.  But what do these pages actually look like and how can we go about looking at them and picking them apart.

For this we’re going to need a couple of undocumented DBCC commands,… Read more

1 comments, 1,529 reads

Posted in SQL Undercover on 15 January 2018

Older posts